DEV Community

Discussion on: 60 Java and Spring Interview Questions You Must Know

Collapse
 
gossie profile image
André Schreck

There are some really interesting questions.
Concerning Q34 I would add a third option, which in my opinion is the best one. Returning an empty java.util.Optional. That way the API implies that the result might be empty and there is no risk of a NullPointerException.