import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
@FunctionalInterface
interface MathInterface {
int cal(int a, int b);
}
class MathClass implements MathInterface {
@Override
public int cal(int a, int b) {
return a/b;
}
}
public class innerClassExample {
public static int test(MathInterface mathInterface) {
return mathInterface.cal(4, 5);
}
public static void main(String args[]) {
MathInterface mathInterface = new MathClass()
{
@Override
public int cal(int a, int b) {
System.out.println("run implments[Not] lamdaType");
return a + b;
}
};
int result = test(mathInterface);
System.out.println(result);
MathInterface mathInterface1 = (a,b)->{return a*b;};
int AA = mathInterface1.cal(1, 2);
System.out.println("결과값은 "+AA);
}
}