By jackolo
via codervirtue.blogspot.com
Published: Mar 17 2009 / 11:07
There is a proposal to introduce a new ?. operator in Java 7 that would allow to call a method on a null object without throwing a NullPointerException and return null or a default value in case of primitives, which often is semantically wrong. The post proposes a way to treat what the method returns when called on a null object is an implementation detail of that method, and how to specify it in the method's body.



Add your comment