1.

What is the difference between boxing and unboxing in Java?

Answer»
BasisBoxingUnboxing
BasicThe object type refers to its VALUE type.It is the PROCESS of fetching value from the boxed object.
StorageThe value STORED on the stack is COPIED to the object stored on the heap memory.The value of the object stored on the heap memory is copied to the value type stored on the stack.
ConversionImplicitExplicit
ExampleInt n = 24;
Object OB = n;
Int m = (int) ob;


Discussion

No Comment Found