# 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
  Modifier and Type
  Field
  Description
  `static final Boolean`
  `FALSE`
  The Boolean object corresponding to the primitive value false.
  `static final Boolean`
  `TRUE`
  The Boolean object corresponding to the primitive value true.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Boolean(boolean value)`
  Allocates a Boolean object representing the value argument.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `booleanValue()`
  Returns the value of this Boolean object as a boolean primitive.
  `int`
  `compareTo(Boolean b2)`
  `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.
  `int`
  `hashCode()`
  Returns a hash code for this Boolean object.
  `static boolean`
  `parseBoolean(String s)`
  `String`
  `toString()`
  Returns a String object representing this Boolean's value.
  `static Boolean`
  `valueOf(boolean b)`
  Returns the object instance of i
  `static Boolean`
  `valueOf(String b)`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### FALSE

    public static final Boolean FALSE
    The Boolean object corresponding to the primitive value false.

  - ### TRUE

    public static final Boolean 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:
      `equals` in class `java.lang.Object`

  - ### hashCode

    public int hashCode()
    Returns a hash code for this Boolean object.
    Overrides:
      `hashCode` in class `java.lang.Object`

  - ### toString

    public String 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:
      `toString` in class `java.lang.Object`

  - ### valueOf

    public static Boolean valueOf(boolean b)

    Returns the object instance of i

    ###### Parameters

    - `b`: the primitive

    ###### Returns

    object instance

  - ### valueOf

    public static Boolean valueOf(String b)

  - ### parseBoolean

    public static boolean parseBoolean(String s)

  - ### compareTo

    public int compareTo(Boolean b2)