Groovy Dereferencing Null Pointer Exceptions Step 13
The most annoying and most common error in Java is the Null Pointer Exception.
If you type:
def a=null
println a.size()
You will get a Null Pointer Exception
If you type
println a?.size(),
it will print null and not throw you a null pointer exception. This makes it a lot easier to check for null pointer exceptions.
(Step 14 Coming Soon)
Tweet This Post
Plurk This Post
Buzz This Post
Delicious This Post
Digg This Post
Ping This Post
Reddit This Post
Stumble This Post
No Comments »
No comments yet.
RSS feed for comments on this post.