I declare a Boolean variable. For example Boolean dataVal=null;
Now if I execute the following code segment:
if(dataVal)
System.out.println("\n\NULL value in dataVal: "+dataVal);
else
System.out.println("\n\nvalue in dataVal: "+dataVal);
I get NullPointerException
. Well, I know its obvious, but I need to know the reason behind this.