Question
What is the main benefit of a lambda expression?
- A. It allows you to convert a primitive to a wrapper class.
- B. It allows you to change the byte code while the application is running.
- C. It allows you to inherit from multiple classes.
- D. It allows you to write code that has the execution deferred.
D.
Note
Option A is incorrect as it describes autoboxing.
Options B and C are not possible in Java.
Option D is correct as it describes lambdas.
Lambdas use deferred execution and can be run elsewhere in the code base.
PreviousNextRelated