Class Byte
java.lang.Object
java.lang.Number
java.lang.Byte
- All Implemented Interfaces:
Comparable<Byte>
The Byte class is the standard wrapper for byte values.
Since: JDK1.1, CLDC 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionByte(byte value) Constructs a Byte object initialized to the specified byte value. -
Method Summary
Modifier and TypeMethodDescriptionbyteReturns the value of this Byte as a byte.intcompare(byte b1, byte b2) intCompares this object to the specified object to determine their relative order.doublebooleanCompares this object to the specified object.floatinthashCode()Returns a hashcode for this Byte.intintValue()longstatic byteAssuming the specified String represents a byte, returns that byte's value.static byteAssuming the specified String represents a byte, returns that byte's value.toString()Returns a String object representing this Byte's value.static BytevalueOf(byte i) Returns the object instance of iMethods inherited from class Number
shortValueMethods inherited from class Object
clone, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()final ClassgetClass()Returns the runtime class of an object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Field Details
-
TYPE
-
SIZE
public static final int SIZE- See Also:
-
MAX_VALUE
public static final byte MAX_VALUEThe maximum value a Byte can have. See Also:Constant Field Values- See Also:
-
MIN_VALUE
public static final byte MIN_VALUEThe minimum value a Byte can have. See Also:Constant Field Values- See Also:
-
-
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
-
equals
-
hashCode
-
parseByte
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
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
-
valueOf
Returns the object instance of i- Parameters:
i- the primitive- Returns:
- object instance
-
intValue
-
longValue
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
compare
public int compare(byte b1, byte b2) -
compareTo
Description copied from interface:ComparableCompares this object to the specified object to determine their relative order.- Specified by:
compareToin interfaceComparable<Byte>- Parameters:
b- the object to compare to this instance.- Returns:
- a negative integer if this instance is less than
another; a positive integer if this instance is greater thananother; 0 if this instance has the same order asanother.
-