java (x,y)->x+y code example
Example 1: java or
int num = 9;
if (num == 1 || num == 2) {
System.out.println("Nope");
}
if (num == 1 || num == 9) {
System.out.println("Yep");
}
Example 2: java "->"
interface LambdaFunction {
void call();
}
class FirstLambda {
public static void main(String []args) {
LambdaFunction lambdaFunction = () -> System.out.println("Hello world");
lambdaFunction.call();
}
}