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

When you say String is immutable, what do you mean by that?
Say I have String s = "Ness"
s= s+"Technologies";
What will happen? If the value gets appended, then what is
the meaning of immutable here?

Answer Posted / bln

Every time a new String objects gets created in this case,
but if assigned value is not same. If assigned, value is
same, then it points to same memory location, even if it is
another variable. For ex;
String s="Test";
String s2="Test";

Now s, s2 points to the same memory location.

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are drawbacks of singleton class?

958


What is the SimpleTimeZone class?

2278


What is default exception handling in java?

1033


What is the difference between yielding and sleeping?

1113


Is stringwriter thread safe?

998


Can a list be null in java?

1050


What are the 7 types of characters?

1081


I want to persist data of objects for later use. What is the best approach to do so?

1066


List types of storage classes in java?

1154


What are thread priorities and importance of thread priorities in java?

1139


How to use Media tracker Class.

1129


How will you serialize a singleton class without violating singleton pattern?

1963


What is an iterator java?

1110


How is a structure different from array ?

1048


What java ide should I use?

993