Hacker News new | past | comments | ask | show | jobs | submit login

Yup. Your IDE will likely highlight it as an issue, but it's totally legal to return a null Optional. There's nothing special about it, it's just a wrapper class.



Did the project to add value types to Java (Iā€™m sure I heard of it a decade ago) never finish?


Not yet, that's Project Valhalla iirc. It's coming along but hasn't been merged yet. I don't believe it's even a preview feature within the JDK yet.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: