Untitled

mail@pastecode.io avatar
unknown
java
a year ago
383 B
3
Indexable
Never
public class Main {
    public static void main(String[] args) {
        MathCalculator sum = (int a,int b) -> a + b;
        MathCalculator sub = (int a,int b) -> a - b;
        int a = 5, b = 10;
        System.out.println(sum.calculate(a,b));
        System.out.println(sub.calculate(a,b));
    }
}

interface MathCalculator {
    public int calculate(int a, int b);
}