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 string is not taking as primitive datatypes but we r
taking it as a class? why explain it?

Answers were Sorted based on User's Feedback



why string is not taking as primitive datatypes but we r taking it as a class? why explain it?..

Answer / ankit

All primitive types have fixed memory size. Now in case of
the String, its length is not fixed and so is its size.
That's why it cannot be a primitive data type.

Is This Answer Correct ?    5 Yes 2 No

why string is not taking as primitive datatypes but we r taking it as a class? why explain it?..

Answer / payel

String should be class so that it can be immutable and
making String immutable, makes it thread safe and
thus imporves performance.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Core Java Interview Questions

how to call a method in different package?

4 Answers  


What does int [] mean in java?

0 Answers  


What is the difference between a field variable and a local variable?

0 Answers  


What is a arraylist in java?

0 Answers  


Why is stringbuffer not immutable?

0 Answers  


What is scope of a variable?

0 Answers   TCS,


How to perform selection sort in java?

0 Answers  


What will happen if we cannot mention "finally" in Java Program ???

3 Answers   PWC,


What language is pass by reference?

0 Answers  


Why char array is preferred over string for storing password?

0 Answers  


Is there a sort function in java?

0 Answers  


What is the use of static class?

0 Answers  


Categories