What's the point of throwing exceptions? For example I stumbled across this:
static List<Integer> list(int [] a) {
if (a == null)
throw new NullPointerException();
//...
But when you don't throw the nullpointer, you'll also get a nullpointer? I see this regularly and I wanted to know if this is a good habit to learn?