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 the kinds of polymorphism?

1073


How many bytes is a char in java?

1002


Enlist few advantages of inheritance?

1057


What are default methods ?

1020


What is a vector in java?

1011


What does null mean in java?

1047


What is the purpose of the wait(), notify(), and notifyall() methods in java programming?

1058


What do you mean by synchronized non access modifier?

980


When is the finalize() called?

1161


What are the restrictions that are applied to the java static methods?

968


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

948


How many digits is int32?

970


What is public static?

1014


What do you understand by classes in java?

989


Explain the hierarchy of java exception classes?

1076