Java's basic data types include: boolean, byte, short, char, int, long, float and double. Java also provides classes related to basic data types to implement encapsulation of basic data types. These classes are in the java.lang package and are: Byte, Integer, Short, Long, Float, Double and Character classes.
Double and Float classes
The Double class and Float class implement class packaging for double and float basic type data. You can use the constructor method Double(double num) of the Double class to create an object of type Double; use the constructor method Float(float num) of the Float class to create an object of type Float. Calling the doubleValue() method on a Double object can return the double-type data contained in the object; calling the floatValue() method on a Float object can return the float-type data contained in the object.
Byte, Short, Integer, Long class
The construction methods of Byte, Short, Integer and Long classes are Byte(byte num), Short(short num), Integer(int num) and Long(long num) respectively. Byte, Short, Integer and Long objects call the byteValue(), shortValue(), intValue() and longValue() methods respectively to return the basic type data contained in the object.
Character class
You can use the constructor Character(char c) of the Character class to create an object of type Character. The Character object calls the charValue() method to return the char type data contained in the object. The Character class also includes some class methods, which can be called directly through the class name for character classification.