What is a Wrapper class?

Answer Posted / praveen

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why scanner is used in java?

802


What is default constructors?

755


Can we call virtual funciton in a constructor ?

1973


How do you identify if jvm is 32-bit or 64-bit from java program?

752


What is the difference between quicksort & mergesort? When should they be used? What is their running time?

859


What is difference between null and void?

744


What is thread life cycle in java?

832


What is type inference in java8?

807


Why arraylist is not synchronized in java example?

716


What is codebase?

779


What is method reference?

738


How to sort an array from smallest to largest java?

804


What type of variable is gender?

767


What is instance means in java?

815


What is data type in java?

713