Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
Java Part 2
« Previous
Next »
_____________ is the process of converting a primitive type data into its corresponding wrapper class object instance.
Options
- unboxing
- autoboxing
CORRECT ANSWER : autoboxing
Discussion Board
Autoboxing
Autoboxing is the name that is used to present automatic converstion of primitive type to their corresponding object wrapper classes. Java compiler makes this automatic conversion possible. For example: converting an int to an Integer, a double to a Double, and so on.
Example of autoboxing:
Character ch = 'a';
So converting a primitive value (an int, for example) into an object of the corresponding wrapper class (Integer) is called autoboxing.
The criteria in which Java compiler applies autoboxing:
1. When a primitive value is passed as a parameter to a method that might be expecting an object of the corresponding wrapper class.
2. When the primitive value is assigned to a variable of the corresponding wrapper class.
Rohit Sharma 08-6-2014 06:07 PM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
Java Beginner (11)
Java (39)
Java (40)
Java (22)
Java (30)
Java (25)
Java (20)
Java (20)
Core Java (20)
Core Java (10)
Core Java (72)
EJB (20)
JDBC (20)
Applet (20)
Struts (21)
Servlets (20)
Java Web Services (20)
Javascript (40)
J2EE (10)
jQuery (46)
Advertisement
▲