Chinese, asked by Anonymous, 5 hours ago

what is ✔ Unboxing:in java
with exmaple?

Answers

Answered by CopyThat
9

Answer :-

Unboxing :-

  • Automatically converting an object of a wrapper class to its corresponding primitive type is known as unboxing. – conversion of Integer to int, Long to long, Double to double etc.

Example:

Integer x=45; // autoboxing where x is object of Integer class

int y=x;  // unboxing where object x is converted to int datatype

Answered by ananyanaskar28
0

Answer:

Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.

Explanation:

Similar questions