Wrapper classes available for primitive types

Java Data Types (Primitive and Non primitive / Reference), Java Variables (Local Variables, Instance Variables and Static or Class Variables), Explicit Declaration of Data Types & Variables, Purpose of Variables, Variable naming restrictions and Data Conversion.
Post Reply
dsusmitha
Posts: 62
Joined: Fri Nov 23, 2018 2:51 am

Wrapper classes available for primitive types

Post by dsusmitha » Thu Dec 06, 2018 9:00 am

What are the Wrapper classes available for primitive types ?

swathi
Posts: 134
Joined: Fri Nov 23, 2018 2:52 am

Re: Wrapper classes available for primitive types

Post by swathi » Thu Dec 06, 2018 9:01 am

Wrapper classes are the classes whose object wraps or contains a primitive data types. When we create an object to a wrapper class, it contains a field and in this field, we can store a primitive data types.
In other words, we can wrap a primitive value into a wrapper class object.

The Wrapper classes available for primitive types are as follows :
boolean - java.lang.Boolean
byte - java.lang.Byte
char - java.lang.Character
double - java.lang.Double
float - java.lang.Float
int - java.lang.Integer
long - java.lang.Long
short - java.lang.Short
void - java.lang.Void

kishore
Posts: 55
Joined: Thu Jan 03, 2019 3:57 am

Re: Wrapper classes available for primitive types

Post by kishore » Sat Jan 05, 2019 5:26 am

Wrapper class in java:
****************************
-->provides the mechanism to convert primitive into object and object into primitive.
-->Since J2SE 5.0, autoboxing and unboxing feature converts primitive into object and object into primitive automatically.
-->The automatic conversion of primitive into object is known as autoboxing and vice-versa unboxing.
-->Eeight classes of java.lang package are known as wrapper classes in java.
boolean Boolean
char Character
byte Byte
short Short
int Integer
long Long
float Float
double Double

Post Reply

Return to “Java Data Types & Variables”