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

java program with complete 4 oops concepts implemented example

0 Answers   Infosys, NIIT,


i need to know the website that i can compile and run a java code in online.(while system doesn't contain any jdk and jre)

0 Answers  


what is heap memory?

0 Answers   Tavant Technologies, Zensar,


Why we override equals() method?

0 Answers  


What are the five major types of reference sources?

0 Answers  


How do you sort a string in alphabetical order in java?

0 Answers  


What is api in java?

0 Answers  


How to create a custom exception?

0 Answers  


When is an object in the mean to garbage collection?

3 Answers  


What are green threads in java?

0 Answers  


Can variables be used in java without initialization?

0 Answers  


what is the output ? Math.floor(-2.1) a)2 b)-2 c)-3.0 d)0

4 Answers   Accenture,


Categories