Question
Rewrite this lambda using a method reference:
() -> Math.random()
- A. Math.random
- B. Math::random
- C. Math::
random()
- D. None of the above
B.
Note
This is a static method reference.
It uses :: to separate the class name and method name.
Option B is correct.
PreviousNextRelated