Class Boolean
java.lang.Object
java.lang.Boolean
public final class Boolean
extends java.lang.Object
The Boolean class wraps a value of the primitive type boolean in an object. An object of type Boolean contains a single field whose type is boolean.
Since: JDK1.0, CLDC 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBoolean(boolean value) Allocates a Boolean object representing the value argument. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of this Boolean object as a boolean primitive.intbooleanequals(java.lang.Object obj) Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object.inthashCode()Returns a hash code for this Boolean object.static booleantoString()Returns a String object representing this Boolean's value.static BooleanvalueOf(boolean b) Returns the object instance of istatic BooleanMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
FALSE
The Boolean object corresponding to the primitive value false. -
TRUE
The Boolean object corresponding to the primitive value true.
-
-
Constructor Details
-
Boolean
public Boolean(boolean value) Allocates a Boolean object representing the value argument. value - the value of the Boolean.
-
-
Method Details
-
booleanValue
public boolean booleanValue()Returns the value of this Boolean object as a boolean primitive. -
equals
public boolean equals(java.lang.Object obj) Returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()Returns a hash code for this Boolean object.- Overrides:
hashCodein classjava.lang.Object
-
toString
Returns a String object representing this Boolean's value. If this object represents the value true, a string equal to "true" is returned. Otherwise, a string equal to "false" is returned.- Overrides:
toStringin classjava.lang.Object
-
valueOf
Returns the object instance of i
Parameters
b: the primitive
Returns
object instance
-
valueOf
-
parseBoolean
-
compareTo
-