91-9990449935 0120-4256464 |
Wrapper class in JavaWrapper class in java provides the mechanism to convert primitive into object and object into primitive. Since J2SE 5.0, autoboxing and unboxing feature converts primitive into object and object into primitive automatically. The automatic conversion of primitive into object is known and autoboxing and vice-versa unboxing. One of the eight classes of java.lang package are known as wrapper class in java. The list of eight wrapper classes are given below:
Wrapper class Example: Primitive to WrapperOutput: 20 20 20 Wrapper class Example: Wrapper to PrimitiveOutput: 3 3 3 |