Class java.lang.Byte
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.lang.Byte

Object
   |
   +----Number
           |
           +----java.lang.Byte

public final class Byte
extends Number
The Byte class is the standard wrapper for byte values.

Version:
1.8, 07/01/98
Author:
Nakul Saraiya
Since:
JDK1.1
See Also:
Number

Variable Index

 o MAX_VALUE
The maximum value a Byte can have.
 o MIN_VALUE
The minimum value a Byte can have.
 o TYPE
The Class object representing the primitive type byte.

Constructor Index

 o java.lang.Byte(byte)
Constructs a Byte object initialized to the specified byte value.
 o java.lang.Byte(String)
Constructs a Byte object initialized to the value specified by the String parameter.

Method Index

 o byteValue()
Returns the value of this Byte as a byte.
 o decode(String)
Decodes a String into a Byte.
 o doubleValue()
Returns the value of this Byte as a double.
 o equals(Object)
Compares this object to the specified object.
 o floatValue()
Returns the value of this Byte as a float.
 o hashCode()
Returns a hashcode for this Byte.
 o intValue()
Returns the value of this Byte as an int.
 o longValue()
Returns the value of this Byte as a long.
 o parseByte(String)
Assuming the specified String represents a byte, returns that byte's value.
 o parseByte(String, int)
Assuming the specified String represents a byte, returns that byte's value.
 o shortValue()
Returns the value of this Byte as a short.
 o toString(byte)
Returns a new String object representing the specified Byte.
 o toString()
Returns a String object representing this Byte's value.
 o valueOf(String, int)
Assuming the specified String represents a byte, returns a new Byte object initialized to that value.
 o valueOf(String)
Assuming the specified String represents a byte, returns a new Byte object initialized to that value.

Variables

 o MAX_VALUE
public static final byte MAX_VALUE
The maximum value a Byte can have.

Since: JDK1.1
 o MIN_VALUE
public static final byte MIN_VALUE
The minimum value a Byte can have.

Since: JDK1.1
 o TYPE
public static final java.lang.Class TYPE
The Class object representing the primitive type byte.

Since: JDK1.1

Constructors

 o Byte
public Byte(byte value)
Constructs a Byte object initialized to the specified byte value.

Parameters:
value - the initial value of the Byte
Since:
JDK1.1
 o Byte
public Byte(String s) throws NumberFormatException
Constructs a Byte object initialized to the value specified by the String parameter. The radix is assumed to be 10.

Parameters:
s - the String to be converted to a Byte
Throws: NumberFormatException
If the String does not contain a parsable byte.
Since:
JDK1.1

Methods

 o byteValue
public byte byteValue()
Returns the value of this Byte as a byte.

Overrides:
byteValue in class Number
Since:
JDK1.1
 o decode
public static java.lang.Byte decode(String nm) throws NumberFormatException
Decodes a String into a Byte. The String may represent decimal, hexadecimal, and octal numbers.

Parameters:
nm - the string to decode
Since:
JDK1.1
 o doubleValue
public double doubleValue()
Returns the value of this Byte as a double.

Overrides:
doubleValue in class Number
Since:
JDK1.1
 o equals
public boolean equals(Object obj)
Compares this object to the specified object.

Parameters:
obj - the object to compare with
Returns:
true if the objects are the same; false otherwise.
Overrides:
equals in class Object
Since:
JDK1.1
 o floatValue
public float floatValue()
Returns the value of this Byte as a float.

Overrides:
floatValue in class Number
Since:
JDK1.1
 o hashCode
public int hashCode()
Returns a hashcode for this Byte.

Overrides:
hashCode in class Object
Since:
JDK1.1
 o intValue
public int intValue()
Returns the value of this Byte as an int.

Overrides:
intValue in class Number
Since:
JDK1.1
 o longValue
public long longValue()
Returns the value of this Byte as a long.

Overrides:
longValue in class Number
Since:
JDK1.1
 o 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.

Parameters:
s - the String containing the byte
Throws: NumberFormatException
If the string does not contain a parsable byte.
Since:
JDK1.1
 o 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.

Parameters:
s - the String containing the byte
radix - the radix to be used
Throws: NumberFormatException
If the String does not contain a parsable byte.
Since:
JDK1.1
 o shortValue
public short shortValue()
Returns the value of this Byte as a short.

Overrides:
shortValue in class Number
Since:
JDK1.1
 o toString
public static java.lang.String toString(byte b)
Returns a new String object representing the specified Byte. The radix is assumed to be 10.

Parameters:
b - the byte to be converted
Since:
JDK1.1
 o toString
public java.lang.String toString()
Returns a String object representing this Byte's value.

Overrides:
toString in class Object
Since:
JDK1.1
 o valueOf
public static java.lang.Byte valueOf(String s,
                                     int radix) throws NumberFormatException
Assuming the specified String represents a byte, returns a new Byte object initialized to that value. Throws an exception if the String cannot be parsed as a byte.

Parameters:
s - the String containing the integer
radix - the radix to be used
Throws: NumberFormatException
If the String does not contain a parsable byte.
Since:
JDK1.1
 o valueOf
public static java.lang.Byte valueOf(String s) throws NumberFormatException
Assuming the specified String represents a byte, returns a new Byte object initialized to that value. Throws an exception if the String cannot be parsed as a byte. The radix is assumed to be 10.

Parameters:
s - the String containing the integer
Throws: NumberFormatException
If the String does not contain a parsable byte.
Since:
JDK1.1

All Packages  Class Hierarchy  This Package  Previous  Next  Index