Re:What if null was an Object in Java?
by Defletter on Sunday April 28, 2024 @12:50PM
(#40189892)
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.
[ Parent
| on HN ]
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.
Re:What if null was an Object in Java?
by steve_rambo on Sunday April 28, 2024 @05:23PM
(#40192099)