June 2004
Intermediate to advanced
848 pages
21h 28m
English
Each of the eight primitive types we have just seen has a corresponding class type, predefined in the Java library. For example, there is a class java.lang.Integer that corresponds to primitive type int. These class types accompanying the primitive types are known as object wrappers and they serve several purposes:
The class is a convenient place to store constants like the biggest and smallest values the primitive type can store.
The class also has methods that can convert both ways between primitive values of each type and printable Strings. Some wrapper classes have additional utility methods.
Some data structure library classes only operate on objects, not primitive variables. The object wrappers provide ...
Read now
Unlock full access