When primitive data type is converted to its corresponding object of its class, it is
called as ___________.
(a) Boxing
(b) Explicit type conversion
(c) Unboxing
(d) Implicit type conversion
Answers
Answered by
4
Answer:
List<Integer> li = new ArrayList<>(); for (int i = 1; i < 50; i += 2) li. add(Integer. valueOf(i)); Converting a primitive value (an int, for example) into an object of the corresponding wrapper class (Integer) is called autoboxing.
Explanation:
make me Brainliest please
Answered by
2
When primitive data type is converted to its corresponding object of its class, it is called as Unboxing.
What about Unboxing :
- Unboxing is the process of automatically converting a wrapper type into its equivalent primitive type. It is the reversal of the autoboxing process.
- To convert a wrapper type to primitives, we no longer need to use the intValue() method of wrapper classes since Java 5.
- In Java, unboxing is the compiler's automatic conversion of a wrapper class object to the value of its appropriate primitive data type. It is the polar opposite of Autoboxing.
Similar questions
Math,
6 hours ago
English,
6 hours ago
Environmental Sciences,
6 hours ago
Math,
12 hours ago
Social Sciences,
12 hours ago
Social Sciences,
8 months ago
English,
8 months ago