Thursday, 12 March 2015

Wrapper Classes: (Core JAVA)

·         Java provides wrapper class to convert primitive type to an object type
·         For every primitive type in java, we have wrapper classes
·         All wrapper classes are available in package “java.lang”. The numeric related wrapper classes are inherited from number class which is abstract class. All the abstract classes are final classes
·         In each wrapper class toString() method, equals() method and hashcode() method are overrided
·         Converting primitive type to object type is known as Boxing operation. This boxing operation is done by using wrapper classes
·         Converting a boxed object back to primitive type is known as unboxing operation
·         If the compiler does the boxing by its own then it will known as Autoboxing
·         Each wrapper class provides method to get primitive vale for e.g., int value ,float value etc

·         In an array of object type whenever any element is added all the data are casted to object type

No comments:

Post a Comment