1.

Differentiate Between Autoboxing And Unboxing ?

Answer»
  • Autoboxing and unboxing are the process used to convert the one variable type into another automatically.
  • Autoboxing is used to convert the PRIMITIVE type into class type while unboxing is used to convert class type into primitive type. If a statement is written in primitive or class type, it is converted VICE versa according to the requirement of the COMPILER.
  • Conversion using Autoboxing and unboxing works only if the type has a value. If objects which are CALLED using constructors are converted, it will result in a compiler error.



Discussion

No Comment Found