Next even number

Report a typo

Write a lambda expression that accepts a long value and returns the next even number.

It is guaranteed that the input number is non-negative.

Solution format. Submit your lambda expression in any valid format with ; at the end.

Examples: x -> x; (x) -> x; (x) -> { return x; };

Sample Input 1:

2

Sample Output 1:

4

Sample Input 2:

317

Sample Output 2:

318
Write a program in Java 17
import java.util.function.LongUnaryOperator;

class Operator {

public static LongUnaryOperator unaryOperator = // Write your code here
}
___

Create a free account to access the full topic