I tried a lambda expression that can be used from java8.
demojava/demo9/Demo9.java
package demojava.demo9;
interface Rtest{
public abstract String Res(Integer x,Integer y );
}
public class Demo9 {
public static void main(String [] args) {
Rtest rtest = (x,y)->{
return "(" + x + ","+ y + ")\n\n";
};
System.out.println(rtest.Res(10,20));
}
}
Execution result
Recommended Posts