Yes, you can replace the definition of an inner class. As long as the interface expected by the method you call has 1 unimplemented method, you can use lambda syntax.
, , . , -, , , . , :
public interface Consumer<T> {
void accept(T t);
}
public class MyClass {
void doSomething(Consumer<String> consumer) { }
}
"doSomething", void, .
. myClassInstance.doSomething(System.out:: Println);
eclipse, , , Intellij 13 . java8, , ( , , , , ).