Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » FundamentalRSS Feeds

Wrapper Classes

Posted By: Tasneem Hashmi     Category: Java     Views: 2872

This article explains about wrapper classes available in java.

A class that wraps primitive values in an object is called wrapper class. Wrapper classes are used to represent primitive values when an Object is required. Notice that an Object starts with a capital letter, while the primitives all start with a lowercase. Also notice that Strings are Objects.

The primitive wrapper classes and their corresponding primitive types are :

 Primitive type

Wrapper Class 

Constructor Arguments 

 byte

Byte 

byte or String 

 short

Short 

short or String

 int

Integer 

int or String 

 long 

Long 

long or String 

 float 

Float 

float, double or String 

 double

Double 

double or String 

 char

Character

char 

 boolean 

Boolean

boolean or String 



Examples of Wrapper Classes

Refer below links for examples of wrapper classes.









  
Share: 

 
 
 

Didn't find what you were looking for? Find more on Wrapper Classes Or get search suggestion and latest updates.

Tasneem Hashmi
Tasneem Hashmi author of Wrapper Classes is from Lahore, Pakistan.
 
View All Articles

 

Other Interesting Articles in Java:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!