3 ms·
It'd be fairly easy to modify Java so that the primitives, including null, behave more like objects. And certainly, Java has inched that direction. It doesn't
by nitwit005 3y ago
It'd be fairly easy to modify Java so that the primitives, including null, behave more like objects. And certainly, Java has inched that direction.
It doesn't solve anything fundamental though. You could make null.toString() return "null", but in most cases that will just be a bug. You're missing a null check or failed to initialize something.