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 »
____________ allow primitive data types to be accessed as objects
Options
- Both b and d
- Serialized class
- Primitive class
- Wrapper classes
CORRECT ANSWER : Wrapper classes
Discussion Board
Wrapper classes
Wrapper classes are used to allow the access of primitive data types by wrapping itself around the data type. Whenever it is required that a data type required as an object then wrapper classes are used. It includes the methods to unwrap the object and provide the conditional procedures to the data type. For example:
A chocolate:
The manufacturer wraps the chocolate with some foil or paper to prevent from pollution. The user takes the chocolate, removes and throws the wrapper and eats it.
The coding it can be denoted as:
int k = 100;
Integer it1 = new Integer(k);
The int data type k is converted into an object, it1 using Integer class. The it1 object can be used in Java programming wherever k is required an object.
Rohit Sharma 08-7-2014 08:42 AM
« 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
▲