answersLogoWhite

0

When we need to store primitive datatypes(The data types we use in genera like:int,long,float etc)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 that primitive data and store it.

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();

That's why we use Wrapper classes in Java

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Which is the wrapper class for the data type float?

The wrapper class for float is Float. java.lang.


What is wrapper class in java?

wrapper class is a predefined class .it is used for converting primitive data types into object type


Is wrapper class final?

yes


Which wrapper class cannot take string in constructor?

useless Q


What kind of gum still comes with a wrapper you can use to make a gum wrapper chain?

Stride?


How do you use wrapper in a sentence?

She undid the candy wrapper. Annalise played with the wrapper as she ate the Snickers bar. Ginny spit her gum back into its wrapper and threw it out. The wrappers on the candy bars had been shredded.


What are wrapped classes?

Wrapped classes are wrapped by Visible ones, which means wrapped ones should be invisible. Adapter Pattern is very closely related to wrapper, because it comes with 2 different flavors: object wrapper and class wrapper. There is also another way to define "wrapped" classes: a private class defined within another class. For example: class TheWrapper { private BeingWrapped _internal; } class TheVisibleOne { private class WrappedClass { } // this class is only accessible in TheVisibleOne } BeingWrapped and WrappedClass are the ones being wrapped/hide by other classes.


How do you use the word write in a sentence?

how do you use the word wrapper in a sentence I would like to write a short note. I will pick up the candy wrapper.


What is meant by wrapper classes?

Java has several "primitive" types (byte, short, int, float, double, boolean, char). Wrapper classes refer to the classes which "wrap up" each of these. For example, the Byte class contains a byte primitive and the methods to modify the class.


How do you use sanitary in a sentence?

a sanitary wrapper on all sandwiches.


How do you build a bank out of popsicle sticks?

You can get a candy wrapper then glue (Iwould use a hot glue gun) the sticks to the wrapper and test it out:)


Will a hershey bar melt quicker with its wrapper or with out its wrapper in the sun?

with its wrapper because the heat will stay trapped inside the wrapper