# Class Byte

java.lang.Object
java.lang.Number
java.lang.Byte

All Implemented Interfaces:
  `Comparable<Byte>`

public final class Byte extends Number implements Comparable<Byte>
The Byte class is the standard wrapper for byte values. Since: JDK1.1, CLDC 1.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final byte`
  `MAX_VALUE`
  The maximum value a Byte can have.
  `static final byte`
  `MIN_VALUE`
  The minimum value a Byte can have.
  `static final int`
  `SIZE`
  `static final java.lang.Class<Byte>`
  `TYPE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Byte(byte value)`
  Constructs a Byte object initialized to the specified byte value.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte`
  `byteValue()`
  Returns the value of this Byte as a byte.
  `int`
  `compare(byte b1, byte b2)`
  `int`
  `compareTo(Byte b)`
  Compares this object to the specified object to determine their relative order.
  `double`
  `doubleValue()`
  `boolean`
  `equals(java.lang.Object obj)`
  Compares this object to the specified object.
  `float`
  `floatValue()`
  `int`
  `hashCode()`
  Returns a hashcode for this Byte.
  `int`
  `intValue()`
  `long`
  `longValue()`
  `static byte`
  `parseByte(String s)`
  Assuming the specified String represents a byte, returns that byte's value.
  `static byte`
  `parseByte(String s, int radix)`
  Assuming the specified String represents a byte, returns that byte's value.
  `String`
  `toString()`
  Returns a String object representing this Byte's value.
  `static Byte`
  `valueOf(byte i)`
  Returns the object instance of i

  ### Methods inherited from class Number

  `shortValue`

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

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

- ## Field Details

  - ### TYPE

    public static final java.lang.Class<Byte> TYPE

  - ### SIZE

    public static final int SIZE
    See Also:
      - Constant Field Values

  - ### MAX_VALUE

    public static final byte MAX_VALUE
    The maximum value a Byte can have. See Also:Constant Field Values
    See Also:
      - Constant Field Values

  - ### MIN_VALUE

    public static final byte MIN_VALUE
    The minimum value a Byte can have. See Also:Constant Field Values
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Byte

    public Byte(byte value)
    Constructs a Byte object initialized to the specified byte value. value - the initial value of the Byte

- ## Method Details

  - ### byteValue

    public byte byteValue()
    Returns the value of this Byte as a byte.
    Overrides:
      `byteValue` in class `Number`

  - ### equals

    public boolean equals(java.lang.Object obj)
    Compares this object to the specified object.
    Overrides:
      `equals` in class `java.lang.Object`

  - ### hashCode

    public int hashCode()
    Returns a hashcode for this Byte.
    Overrides:
      `hashCode` in class `java.lang.Object`

  - ### parseByte

    public static byte parseByte(String s) throws NumberFormatException
    Assuming the specified String represents a byte, returns that byte's value. Throws an exception if the String cannot be parsed as a byte. The radix is assumed to be 10.
    Throws:
      `NumberFormatException`

  - ### parseByte

    public static byte parseByte(String s, int radix) throws NumberFormatException
    Assuming the specified String represents a byte, returns that byte's value. Throws an exception if the String cannot be parsed as a byte.
    Throws:
      `NumberFormatException`

  - ### toString

    public String toString()
    Returns a String object representing this Byte's value.
    Overrides:
      `toString` in class `java.lang.Object`

  - ### valueOf

    public static Byte valueOf(byte i)

    Returns the object instance of i

    ###### Parameters

    - `i`: the primitive

    ###### Returns

    object instance

  - ### intValue

    public int intValue()
    Specified by:
      `intValue` in class `Number`

  - ### longValue

    public long longValue()
    Specified by:
      `longValue` in class `Number`

  - ### floatValue

    public float floatValue()
    Specified by:
      `floatValue` in class `Number`

  - ### doubleValue

    public double doubleValue()
    Specified by:
      `doubleValue` in class `Number`

  - ### compare

    public int compare(byte b1, byte b2)

  - ### compareTo

    public int compareTo(Byte b)
    Description copied from interface: `Comparable`

    Compares this object to the specified object to determine their relative order.

    ###### Parameters

    - `another`: the object to compare to this instance.

    ###### Returns

    Specified by:
      `compareTo` in interface `Comparable<Byte>`
    Returns:

      a negative integer if this instance is less than `another`; a positive integer if this instance is greater than `another`; 0 if this instance has the same order as `another`.

      ###### Throws

      - `ClassCastException`: @throws ClassCastException if `another` cannot be converted into something comparable to `this` instance.