Originally posted by Saket Barve:
Here is a question from DanChisholm's single topic exams. Can someone tell me why the line number 5 does not throw a NullPointerException?
We know that c is null and are trying to cast a null into an array of integers. How can that be?
Thanks,
Saket
Null pointer exeption is only thrown when you try to access a member variable or call a method on a null object.
Java allows you to cast a null object to any type, although it's still a null after casting.