number class in Java

Java provides wrapper classes for primitive number types. These classes "wrap" the primitive in an object. Often, the wrapping is done by the compiler—if you use a primitive where an object is expected, the compiler boxes the primitive in its wrapper class for you. Similarly, if you use a number object when a primitive is expected, the compiler unboxes the object for you. 
Not like primitives, none of the wrapper classes will widen from one to another.