Module java.base
Package java.lang

# Class Boolean

≠
public final class Boolean
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<java.lang.Boolean>, java.lang.constant.Constable
Comparing jdk-master and valhalla-csr-open

All Implemented Interfaces:
  `Serializable, Comparable<Boolean>, Constable`

public final class Boolean extends Object implements Serializable, Comparable<Boolean>, Constable
The `Boolean` class is the wrapper class for values of the primitive type `boolean` . An object of type `Boolean` contains a single field whose type is `boolean` .

In addition, this class provides many methods for converting a `boolean` to a `String` and a `String` to a `boolean` , as well as other constants and methods useful when dealing with a `boolean` .

This is a value-based class; programmers should treat instances that are equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail mutexes, or with object references.

When preview features are enabled, `Boolean` is a value classPREVIEW . Use of value class instances for synchronization, mutexes, or with object references result in `IdentityException` PREVIEW Moved out of a paragraph.Moved to a division with class preview-block.Moved to a division with class preview-comment..

Since:
  1.0
See Also:
  - Serialized Form

## Fields

- =
  public static final java.lang.Boolean FALSE
- =
  public static final java.lang.Boolean TRUE
- =
  public static final java.lang.Class<java.lang.Boolean> TYPE

## Constructors

- =
  @Deprecated(since="9")
  public Boolean(boolean arg0)
- =
  @Deprecated(since="9")
  public Boolean(java.lang.String arg0)

## Methods

- =
  public boolean booleanValue()
- =
  public static int compare(boolean arg0, boolean arg1)
- =
  public int compareTo(java.lang.Boolean arg0)
- =
  public java.util.Optional<java.lang.constant.DynamicConstantDesc<java.lang.Boolean>> describeConstable()
- =
  public boolean equals(java.lang.Object arg0)
- =
  public static boolean getBoolean(java.lang.String arg0)
- =
  public int hashCode()
- =
  public static int hashCode(boolean arg0)
- =
  public static boolean logicalAnd(boolean arg0, boolean arg1)
- =
  public static boolean logicalOr(boolean arg0, boolean arg1)
- =
  public static boolean logicalXor(boolean arg0, boolean arg1)
- =
  public static boolean parseBoolean(java.lang.String arg0)
- =
  public java.lang.String toString()
- =
  public static java.lang.String toString(boolean arg0)
- =
  public static java.lang.Boolean valueOf(boolean arg0)
- =
  public static java.lang.Boolean valueOf(java.lang.String arg0)

## Serialized Form

=

### serialVersionUID

=-3665804199014368530

### Serialized Fields

- =
  boolean value

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
Boolean |  |  |  |  |  |  | 7 | 2 |  | 9
Total |  |  |  |  |  |  | 7 | 2 |  | 9