Question

 Explain use of Unboxing and Autboxing in Java with the help of example. 

27 Apr 2023
Answer :
Word Count : 248

In Java, autoboxing and unboxing are mechanisms that allow automatic conversion between primitive types and their corresponding wrapper classes. Autoboxing converts a primitive type to its corresponding wrapper class object, while unboxing converts a wrapper class object to its corresponding primitive type. These mechanisms simplify the process of working with both primitive types and objects. Here's an example to illustrate their use:

Integer num = 10; // Autoboxing - primitive int to Integer object System.out.println(num); // Outputs: 10

In this example, the integer value 10 is assigned to the Integer object num directly.

_______ ______ __________ ____ __________ _____ _________ ____.
___ _________ __________ __________ _______ _________.
________ ____ ________ __________ ___ ____ _________ ______.
_____ __________ ___ ________ ______ _________ _____ ___ ___.
___ _________ ______ ____ __________ __________ ______ ____ _____ ___ ____ _________.
________ _________ _______ ___ ___ ________ _____ ________ ____ ___.
__________ _______ ______ ______ ____ _____.
_________ _____ _______ ____ ____ _________.
_________ _____ _______ ____ ______ ________ ________ _______ ______.
_________ _______ ______ ___ __________ ____ __________ _________ ____.
_____ ________ _________ __________ _________.
________ __________ ___ _____ ________ ___ ________ __________ _____.
_______ _____ _____ ________ _______ ________ __________ __________ ____ ________ ___ ___.
____ _____ ________ _________ _________ _________ __________ _____ ___.
______ ______ _________ __________ __________ ___ _______.
_________ ______ _____ _______ _____ ______ ________ _____.
_______ ____ ____ _________ _______ ________ __________ ________.
______ ______ ________ ________ _________ ________ _______ ___.
__________ _______ ______ _________ ______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCS 206 2022 2023 -  Explain use of Unboxing and Autboxing in Java with the help of e | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→