Tuesday, August 4, 2015

Java Autoboxing and unboxing

Autoboxing: Java converts primitive types to its wrapper class when object is expected;
Unboxing: Java converts the object to its primitive type value when primitive type is expected.

Details here.

Primitive typeWrapper class
booleanBoolean
byteByte
charCharacter
floatFloat
intInteger
longLong
shortShort
doubleDouble

No comments:

Post a Comment