News for hackers. Stuff that matters.
Re:A categorized list of all Java and JVM features since JDK... by savanu on Thursday April 01, 2021 @03:37PM (#26665073)
So you are really looking for compiler checks for null? Kind of like kotlin?

var truthy = null; // Compile fails

var nullable? = null; // Compile passes

You don't need value types for this?

Re:A categorized list of all Java and JVM features since JDK... by bluejekyll on Thursday April 01, 2021 @04:50PM (#26665848)
That's not exactly the same thing... It can also (again I don't know if this is part of the jep or not) be used to perform stack based destructors (finalize) and then Java could implement RAII. Reading the jep it discusses perhaps rejecting finalize as function on primitive objects, so this might not be in scope.

Additionally, the type is also lighter weight than an Object and should be stack allocated, so there are memory advantages to not having to use boxed types as well.