I want to know the difference between Boolean.TRUE and true values inside an if clause. Why does it give me a compilation error (that
Boolean.TRUE
true
if
It does throw this error because it does not know what hides behind Boolean.TRUE. TRUE is a static field of the type boolean in the class Boolean, but its value could also be false. It isn't obviously, 'though.
TRUE
false