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

Is singleton thread safe in java?

920


What is difference between final and finally in java?

1034


What are different types of states exist for a thread?

963


Which sorting algorithm is best in java?

939


How do you read and print a string in java?

910


How is Object Oriented Programming different from Procedure Oriented Programming?

990


How do you input a string in java?

998


What are the different tags provided in jstl?

915


Can we compare two strings in java?

959


Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx

2062


What is the default value of local and global variables?

1043


In java how do we copy objects?

1003


How is it possible in java programming for two string objects with identical values not to be equal under the == operator?

976


can java object be locked down for exclusive use by a given thread? : Java thread

1025


What is classes in java?

885