I use object != null a lot to avoid NullPointerException.
object != null
Is there a good alternative to this?
For example I often use:
In addition to using assert you can use the following:
assert
if (someobject == null) { // Handle null here then move on. }
This is slightly better than:
if (someobject != null) { ..... ..... ..... }