March 2002
Intermediate to advanced
480 pages
18h 40m
English
Boolean
Boolean provides an object wrapper for a Java
boolean primitive. The constructor initializes the
wrapper with the value true or false,
after which the object becomes immutable. For convenience, the static
variables Boolean.TRUE and Boolean.FALSE
refer to predefined instances of this class with the values
true and false, respectively, and
should normally be used instead of constructing a new instance.
The booleanValue() method can be used to retrieve
the boolean value of a Boolean
object. In addition, the toString() method will return
the string "true" or "false" as
appropriate.
public final class Boolean { // Public Constructors public Boolean( boolean value); // Public Instance Methods public boolean booleanValue(); // Public Methods Overriding Object public boolean equals( Object obj); public int hashCode(); public String toString(); }
Read now
Unlock full access