Gegeben sei folgendes Interface
public Interface BspInterface {
public int mach(int x);
}
und die folgende Methode:
public static void main(String[] args) {
int y = 42;
Function<Integer, Integer> f = a -> a * a;
BspInterface b1 = x -> x * 2;
BspInterface b2 = Math::abs;
BspInterface b3 = x -> b1.mach(x) * 2;
BspInterface b4 = x -> y;
BspInterface b5 = x -> f.apply(x);
System.out.println("b1: " + b1.mach(-3));
System.out.println("b2: " + b2.mach(-3));
System.out.println("b3: " + b3.mach(-3));
System.out.println("b4: " + b4.mach(-3));
System.out.println("b5: " + b5.mach(-3));
}
Welche der folgenden Ausgaben werden ausgegeben?