Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

why the primitive data type have classes?

Answer Posted / manikandan [ gtec,vellore ]

there are different type of data types such as int,char
etc.for example suppose if we using arrays it can store a
similar data types but we need to store a char and int in a
same array what can we do for this situation. the wrapper
class helps in this situation by storing a objects in to a
arrays.

example

ArrayList v=new ArrayList();
v.add(new Integer(1));
v.add(new Character('a'));//

the int and char are different type but we stores it by an
object.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is math exp in java?

1052


what is meant by encapsulation?

1085


What is the default access specifier for variables and methods of a class?

1207


What is jvm? Why is java called the platform independent programming language?

1023


What are the two ways of implementing multi-threading in java?

1513


What is the use of default method in interface in java? Explain

1006


What is the difference between a local variable and an instance variable?

1110


What is the use of beaninfo?

1047


Explain about strings in java?

1076


what are the methods in object?

1150


What data structures are used to perform recursion?

1055


What is an escape character in java?

1039


What is += mean in java?

1000


What's the difference between comparison done by equals method and == operator?

974


Describe the syntax of multiple inheritance? When do we use such an inheritance?

1096