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...

hi to all. well can you please tell me that why String class
is immutable?

Thanks in advance.

Answer Posted / hari

Well it is immutable because of the memory concern. For
every new string if there is new object then it will take
lot of memory and if there is such requirement then there
is StringBuffer class provided.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?

1324


Explain listiterator and methods in listiterator?

1025


What is early binding and late binding in java?

1195


I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?

1175


Does java vector allow null?

968


What is the function of log?

1012


Distinguish between a predicate and a function?

990


Why is stringbuffer not immutable?

1088


How static variable work in java?

1130


What is the difference between inner class and nested class?

1096


How do you change an int to a string?

1014


Can we assign null to double in java?

1016


When will we prefer to use set and list in java and why?

965


What is parameters example?

1035


Is array passed by reference in java?

1032