4 ms·
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
by savanu 6y ago
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?
- bluejekyll 6y agoThat'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.