Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

pass a function as parameter

public interface MyInterface {
    String doSomething(int param1, String param2);
}
class MyClass {
    public MyInterface myInterface = (p1, p2) -> { return p2 + p1; };
}

new Thread(this::someMethod).start();
 
PREVIOUS NEXT
Tagged: #pass #function #parameter
ADD COMMENT
Topic
Name
2+7 =