A primitive wrapper class in the java programing language is one of eight classes provided in the java.lang package to provide object method to the eight primitive types. All of the primitive wrapper classes in Java are immutable. J2SE 5.0 introduced autoboxing of primitive types into their wrapper object, and automatic unboxing of the wrapper objects into their primitive value—the implicit conversion between the wrapper objects and primitive values.
Wrapper class is used to represent primitive values when an object is required. The wrapper classes are used extensively with collection classes in the java.utill package and with the classes in the reflection package
The primitive wrapper classes and their corresponding primitive types are:
The Byte
, Short
, Integer
, Long
, Float
, and Double
wrapper classes are all subclass of the Number class
0 comments:
Post a Comment