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

String is immutable.it is true
String can be change to mutable How?

Answer Posted / java

String s = "PROJECT";
String s2 = s.toLowerCase();

System.out.println(s.equals("PROJECT")); // Prints true
System.out.println(s.equals(s2)); // Prints false
In comparison, consider what would happen if Strings were mutable.

MutableString ms = "PROJECT";
MutableString ms2 = ms.toLowerCase();

System.out.println(ms.equals("PROJECT")); // Prints false
System.out.println(ms.equals(ms2)); // Prints true

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are memory considerations of jsp compares to other web components?

6539


Difference between DurableSubscription and non- DurableSubscription?

2196


Why are some of the class and element names counter-intuitive?

1148


What are the difference between RMI and CORBA?

1116


What is threadfactory?

1101


Brief description about local interfaces?

1273


What is the difference between the session.update() method and the session.lock() method?

1015


How would you detect a keypress in a jcombobox?

1142


To what value is a variable of the string type automatically initialized?

1137


Why do I get a duplicate name error when loading a jar file?

1152


What is jboss?

1039


Describe responsibilities of Activator?

2277


What is a modular application?

1084


How are the elements of a cardlayout organized?

1085


What are the benefits of detached objects?

1054