← Quiz: Java 8 Lambdas and Streams: all 10 questions
Quiz: Java 8 Lambdas and Streams · Question 5 of 10
Which is the method reference for s - s.length()?
Which is the method reference for s -> s.length()?
- A.s::length
- B.String::length
- C.length::String
- D.String.length()
Answer & explanation
Correct answer: String::length
Class::method refers to the instance method called on each element.
Can you get the rest right without peeking?
Take the timed Quiz: Java 8 Lambdas and Streams quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →