I declare a Boolean variable. For example Boolean dataVal=null; Now if I execute the following code segment:
Boolean dataVal=null;
if(dataVal) System.out.prin
Boolean (class) != boolean (primitive type).
Java tries to get the primitive value calling dataVal.booleanValue(). Because dataVal is null, you get a null pointer exception.