mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
introduce functional variable (IDEA-141244)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
class Test {
|
||||
void foo(String s) {
|
||||
if (true) {
|
||||
Consumer<String> stringConsumer = new Consumer<String>() {
|
||||
public void accept(String s) {
|
||||
System.out.println("Hello, world " + s);
|
||||
System.out.println();
|
||||
}
|
||||
};
|
||||
stringConsumer.accept(s);
|
||||
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user