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
Because dataVal is being casted to boolean using Boolean.booleanValue() which gets translated to null.booleanValue() which leads you to a NullPointerException.
dataVal
boolean
Boolean.booleanValue()
null.booleanValue()