AA shorthand syntax for lambda expressions that call existing methods
BAn operator for accessing private members
CA way to create anonymous classes
DA reference to a method's memory address
Correct Answer:
A. A shorthand syntax for lambda expressions that call existing methods
EXPLANATION
Method references are compact lambda expressions that directly reference existing methods. They use :: syntax and are equivalent to lambdas that call those methods.
What is the primary advantage of using lambda expressions in Java 8+?
AThey reduce boilerplate code and enable functional programming style
BThey increase execution speed significantly
CThey eliminate the need for classes
DThey are required for all stream operations
Correct Answer:
A. They reduce boilerplate code and enable functional programming style
EXPLANATION
Lambda expressions reduce boilerplate code by allowing inline implementation of functional interfaces without creating anonymous inner classes, enabling a more functional programming style.