presumably_wrong@lemm.eetoJava@programming.dev•What are some things in the class library you wish more people knew about or used?English
1·
1 year agoInstead of wrapping it in an optional you can do Objects.requireNonNullElse(value, defaultValue)
Instead of wrapping it in an optional you can do Objects.requireNonNullElse(value, defaultValue)
In java 9 there is Objects.requireNonNullElse(obj, defaultValue)
I’d hope they come here but get a refresh. /r/cscareeradvice was basically just a circlejerk of you have to grind leetcode and work at faang or you’re useless.