What is the purpose of a method reference in Java?

  1. To create anonymous classes
  2. To reference methods without executing them
  3. To invoke methods immediately
  4. To define interfaces
Correct answer To reference methods without executing them

Explanation

Method references refer to methods without executing them, used in functional programming.

Update: Admin added a tag on this question

Topics

By Admin · · 33 views