4 ms·
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 clas
by Defletter 2y ago
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.
- alkonaut 2y agoDid the project to add value types to Java (I’m sure I heard of it a decade ago) never finish?
- Defletter 2y agoNot 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.
- steve_rambo 2y agohttps://openjdk.org/projects/valhalla https://openjdk.org/projects/valhalla