8.2. Void
The Void class is the exception to all the preceding rules because it has no values to wrap, provides no
methods, and cannot be instantiated. It has only a static TYPE field containing a reference to the Class
object void.class. The language has no void typevoid is a placeholder indicating no return type. The
Void class represents that lack of an actual return type and is only used in reflection (see "The Method Class"
on page 420).
8.3. Boolean
The Boolean class represents the boolean type as a class. Both the constructor that decodes a string, the
valueOf method and the parseBoolean method understand "TRue", with any mixture of uppercase and
lowercase characters, to be TRue. Any other string is interpreted as false.
The Boolean class has two static references to objects corresponding to each of the primitive boolean
values: Boolean.TRUE and Boolean.FALSE.
8.4. Number
The Number class is an abstract class extended by all wrapper classes that represent primitive numeric types:
Byte, Short, Integer, Long, Float, and Double.
The abstract methods of Number return the value of the object converted to any of the numeric types:
public byte byteValue()
public short shortValue()
public int intValue()
public long longValue()
public float floatValue()
public double doubleValue()
Each extended Number class overrides these methods to convert its own type to any of the others under the
same rules used for an explicit cast. For example, given a Float object with the value 32.87, the return
value of intValue on the object would be 32 , just as "(int)32.87 " would be 32.
8.4.1. The Integer Wrappers
The classes Byte, Short, Integer, and Long extend Number to represent the corresponding integer
types as classes. In addition to the standard Number methods, each of the integer wrapper classes supports
the following methods:
public statictypeparseType(String str, int radix)
Converts the string str into a numeric value of the specified type, using
the given radix. For example, Integer.parseInt("1010",2) returns
10, and Integer.parseInt("-1010",2) returns 10. The characters in
the string must all be valid digits for the given radix, except that the first
character may be a minus sign to indicate a negative value. A
NumberFormatException is thrown if str contains any other