Free Tutorial 4 All


RESOURCES

Groovy Dereferencing Null Pointer Exceptions Step 13

Posted by admin | Photoshop | Wednesday 13 January 2010 8:39 am

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)

[Post to Twitter] Tweet This Post  [Post to Plurk] Plurk This Post  [Post to Yahoo Buzz] Buzz This Post  [Post to Delicious] Delicious This Post  [Post to Digg] Digg This Post  [Post to Ping.fm] Ping This Post  [Post to Reddit] Reddit This Post  [Post to StumbleUpon] Stumble This Post 

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

atriumax wordpress theme