Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Help Java W Wrapper

Related Tutorials


 
 

Share on Google+Share on Google+

Wrapper

Advertisement
Java provides wrapper classes corresponding to each primitive data types in its "lang" package.

Wrapper

     

Java provides wrapper classes corresponding to each primitive data types in its "lang" package. These classes represent the primitive values as objects offers utility methods to manipulate the values. All of the primitive wrapper classes in Java are immutable. Converting primitive types into the corresponding wrapper object can be helpful in situations where only objects can be utilized. For example, if you want to store a set of char values in a Vector, the values in a Vector must be objects and not primitives. In that case you need to convert char values into Character objects. 

Here is the list of primitive types and corresponding wrapper class:

Primitive type Wrapper class
byte Byte
short Short
int Integer
long Long
float Float
double Double
char Character
boolean Boolean


Read more at:

http:/www.roseindia.net/java/wrapper-class/wrapper-classes.shtml

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 18, 2009

Related Tutorials

Discuss: Wrapper  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
Gnanaprakash
June 27, 2012
pls give examples

these tutorials are nice. but providing examples brings excellent.
DMCA.com