Functional Interface UnaryOperator - Quiz
Total: 3 questions
1. When UnaryOperator interface can be used?
When UnaryOperator interface can be used?
It is used to work on a single operand and it returns the same type as an operand. The UnaryOperator can be used as lambda expression to pass as an argument.
2. Use UnaryOperator in lambda expression to convert string to upper case.
Use UnaryOperator in lambda expression to convert string to upper case.
UnaryOperator<String> uo = String::toUpperCase;
System.out.print(uo.apply("Ocpjp 8"));
3. The static method of the UnaryOperator interface.
The static method of the UnaryOperator interface.
static <T> UnaryOperator<T> identity()
Page 1 of 1