When we give gifts, we wrap them nicely in a box. The gift may be a doll or a toy car or something else. The box and the glossy paper around it make it attractive. We have worked with simple data types. Now Java wants to wrap them and make them more attractive (useful). For this, Java provides an interesting concept of wrapper classes.
We have studied the basic data type
float. It holds floating-point number. Now Java provides a class
Float. As identifiers are case sensitive,
float are different. The new class
Float is for storing floating-point values only. But it is a class, a wrapper class.
Similarly, a bare number of type
int is wrapped nicely in a class
Integer. We know that classes have ...