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