ALLInterview.com :: Home Page KalAajKal.com
 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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
What is a Wrapper class?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is a Wrapper class?
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 ?    48 Yes 3 No
Debapriya Patra
 
  Re: What is a Wrapper class?
Answer
# 2
Wrapper classes are classes that allow primitive types to 
be accessed as objects.
 
Is This Answer Correct ?    39 Yes 4 No
Janet
 
 
 
  Re: What is a Wrapper class?
Answer
# 3
wrapper class allows us to make use of primitive datatypes 
as objects
 
Is This Answer Correct ?    15 Yes 1 No
Ravikiran
 
  Re: What is a Wrapper class?
Answer
# 4
Wrapper classes are classes that allow primitive types to 
be accessed as objects.
 
Is This Answer Correct ?    14 Yes 4 No
Nikhil
 
  Re: What is a Wrapper class?
Answer
# 5
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 ?    20 Yes 1 No
Praveen
 
  Re: What is a Wrapper class?
Answer
# 6
wrapper classes is nothing but the primitive datatypes make
as a class name is called a wrapper class
 
Is This Answer Correct ?    5 Yes 2 No
Vinay
 
  Re: What is a Wrapper class?
Answer
# 7
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 ?    6 Yes 1 No
Srinivas D
 
  Re: What is a Wrapper class?
Answer
# 8
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 ?    3 Yes 1 No
Kanaparthi Srinivas
 
  Re: What is a Wrapper class?
Answer
# 9
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 ?    3 Yes 0 No
Darshan
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Default layout of panel and frame?  2
What is thin driver and thick driver. why it is called so? Logisoft1
What is the diff. b/w Interfaces & Abstract class? Ericsson4
What is the use of bin and lib in JDK?  3
What is the use of Getters and Setters method ?  2
What is the use of an interface?  3
public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod TCS3
Explain Stream Tokenizer?  3
How to declare unique ArrayList ? RMSI4
How java is platform independent? TCS12
What is the use of anonymous inner classes ? HCL8
Difference between a Scrollbar and a ScrollPane?  1
Difference between JDK, JRE, JVM Oracle5
If a multi threaded Java program has started numerous number of threads, at any point in time how to know which thread is currently executing/running ? iFlex7
What is static variable and static method? TCS8
What is System class and its purpose?  2
how cani read a command line argument?(usingfile object).  3
Explain class A{} class B{} class C{} all the three classes are saved in a single file name, what the name should i provide to the file ,in what file name should i run the program? Ple Explain DNS6
What is the relationship between a method?s throws clause and the exceptions that can be thrown during the method?s execution?  2
What is the difference between java and .Net? Bosch5
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com