Class Boolean

Summary

No no-arg constructor. You can only:

Boolean b = new Boolean(true);
Boolean b =new Boolean("true"); 

Note: as for second constructor, allocate value true if the string argument is not null and is equal, ignoring case, to the string "true". Otherwise, allocate a Boolean object representing the value false!

Boolean.FALSE is 'new Boolean(false)' and Boolean.TRUE is 'new Boolean(true)', they return a Boolean object.

Boolean.TYPE is 'Class.getPrimitiveClass("boolean")', it return a Class object.

Note: getPrimitiveClass is a native class so you cannot find it in JDK API document.

static native Class getPrimitiveClass(String name);

The hashCode() method will return the integer 1231 if this object represents true; returns the integer 1237 if this object represents false.

 

 

Reference

Sun's Hierarchy For Package java.lang - Class Boolean