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 incompatible types in java?

818


What defines function?

756


What is difference overloading and overriding?

825


What are the four versions of java?

789


Can a class be private?

736


What are the advantages of java inner classes?

799


What is ++ a in java?

780


What are parsers? Dom vs sax parser.

807


Can we create a constructor in abstract class?

790


How many bits is a float?

777


What is the function of http?

793


What is == and === in javascript?

784


Which data type is a class in java?

787


What are static variables and functions?

860


What are the differences between abstract class and interface?

778