What are wrapper classes?

Answer Posted / priyanka

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.

int is a primitive data type , where as Integer is a class
which encapsulates the primitive int data type and
represents in terms of object.

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dynamic binding(late binding)?

594


What is the difference between the size and capacity of a vector?

571


How do you clear an arraylist in java?

502


What is a variable simple definition?

581


What is a method type?

540






Enlist diffrent types of inheritance supported by java?

489


Can we override the private methods?

529


When will we use them?

601


Why java uses the concept of the string literal?

548


Define iterator and methods in iterator?

547


How do I remove a character from a string in java?

506


What is the difference between an interface and an abstract class?

543


What all access modifiers are allowed for top class ?

715


Is there any difference between nested classes and inner classes?

542


What is concurrent hashmap and its features?

529