Which method will throw if there is no element in the stream?
Correct answer
findFirst().get()
Explanation
Calling `get()` on an empty Optional will throw NoSuchElementException.
Update: Admin added a tag on this question
Topics
By Admin · · 25 views