ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Core Java
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1722)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (147)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
What is a Wrapper class?
 Question Submitted By :: Core-Java
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
When we need to store primitive datatypes as objects, we use
wrapper classes.MEans in utility classes all the utility
classes stores Objects.So when we need to store a primitive
datatype.We make an object of theat primitive data and store it.

Thats why we use Wrapper classes in Java.
 
Is This Answer Correct ?    172 Yes 21 No
Debapriya Patra
 
Answer
# 2
Wrapper classes are classes that allow primitive types to
be accessed as objects.
 
Is This Answer Correct ?    111 Yes 18 No
Janet
 
 
 
Answer
# 3
Say supposing there is a requirement to store only the
object in an array A.The Primitive types cannot be stored in
the same array as the array can accommodate only Objects
here is where Wrapper Class come into picture.ie, we create
wrapper for the primitive types.One such example is as below

Ex:int i;
Wrapper class for the primitive type(int) is created as below:

INTEGER i = new INTEGER();
 
Is This Answer Correct ?    58 Yes 14 No
Praveen
 
Answer
# 4
wrapper class allows us to make use of primitive datatypes
as objects
 
Is This Answer Correct ?    55 Yes 16 No
Ravikiran
 
Answer
# 5
Wrapper classes are classes that allow primitive types to
be accessed as objects.
 
Is This Answer Correct ?    50 Yes 13 No
Nikhil
 
Answer
# 6
ExAMPLE:

int i=100 // declaration of primitive type.

/* wrapping the primitive data type to corresponding wrapper
class object */

Integer i1=new Integer(i);
 
Is This Answer Correct ?    31 Yes 5 No
Kanaparthi Srinivas
 
Answer
# 7
A primitive wrapper class in the Java programming language
is one of eight classes provided in the java.lang package to
provide object methods for the eight primitive types. All of
the primitive wrapper classes in Java are immutable. J2SE
5.0 introduced autoboxing of primitive types into their
wrapper object, and automatic unboxing of the wrapper
objects into their primitive value—the implicit conversion
between the wrapper objects and primitive values.

Wrapper classes are used to represent primitive values when
an Object is required. The wrapper classes are used
extensively with Collection classes in the java.util package
and with the classes in the java.lang.reflect reflection
package.

The primitive wrapper classes and their corresponding
primitive types are:

Primitive type Wrapper class Constructor Arguments
byte Byte byte or String
short Short short or String
int Integer int or String
long Long long or String
float Float float, double or String
double Double double or String
char Character char
boolean Boolean boolean or String

The Byte, Short, Integer, Long, Float, and Double wrapper
classes are all subclasses of the Number class.
 
Is This Answer Correct ?    27 Yes 10 No
Darshan
 
Answer
# 8
wrapper classes is nothing but the primitive datatypes make
as a class name is called a wrapper class
 
Is This Answer Correct ?    20 Yes 13 No
Vinay
 
Answer
# 9
we can't store the different types of objects(primitive
datatypes can not be stored) in the same array(same types
of objects can be stored). so, we can crate a primitive
data type for int i;
as INTEGER i = new INTEGEr();
This is the procedure actually going on.
 
Is This Answer Correct ?    15 Yes 8 No
Srinivas D
 
Answer
# 10
A primitive wrapper class in the Java programming language
is one of eight classes provided in the java.lang package to
provide object methods for the eight primitive types. All of
the primitive wrapper classes in Java are immutable. J2SE
5.0 introduced auto boxing of primitive types into their
wrapper object, and automatic unboxing of the wrapper
objects into their primitive value—the implicit conversion
between the wrapper objects and primitive values.

Wrapper classes are used to represent primitive values when
an Object is required. The wrapper classes are used
extensively with Collection classes in the java.util package
and with the classes in the java.lang.reflect reflection
package.

The primitive wrapper classes and their corresponding
primitive types are:

Primitive type Wrapper class Constructor Arguments
byte Byte byte or String
short Short short or String
int Integer int or String
long Long long or String
float Float float, double or String
double Double double or String
char Character char
boolean Boolean boolean or String

The Byte, Short, Integer, Long, Float, and Double wrapper
classes are all subclasses of the Number class.This Number
class is subject to the object class
 
Is This Answer Correct ?    6 Yes 2 No
Sandeep Sagala
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What classes of exceptions, caught by a catch clause?   1
What is a reflection package?   2
what is the output??????? public class multireturn { public(int assign x ( int x) { if(4==x) { return 7; } else if (7=x+3) { return 6; } return 5; } } TCS 3
whats the life cycle of jsp Satyam 15
can we access the super class method using subclass object?   4
how to write a program for chat function using core java Satyam 1
What are listeners in java and explain ? TCS 2
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.   1
Why java is free from garbage values??   4
What are parent methods and how can you call them?   2
Suppose there is an Online shopping cart application having different objects like Cart, SelectionItem, Billing, COnfiguration, Authentication, Authorization, PersonalDetails etc. Out of this which one can be made a singleton pattern and why? RBS 2
What are MalformedURLException and UnknownHost Exceptions and whey they will be thrown?   2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright © 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com