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

I have a String s = java; What is the output when I say
s.replaceAll('j', 'k'); Also what is the value of s after
replacing?

Answer Posted / puneet

No, the strings are immutable; the value of s will be the
same but new object kava will get crated which wil have no
refrence. s will refer to the same object which is not
changed.
s=s.replace("",""); should have worked...otherways

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are local variables?

1018


Can we catch more than one exception in a single catch block?

1034


What is fail fast in java?

1087


What are the super most classes for all the streams?

2451


What is the base class of all classes?

1012


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

1020


How are variables stored?

936


What is finally in Java?

1031


what is the significance of listiterator in java?

1046


What is the difference between conversation & casting?

1010


Is 0 an irrational number?

1014


What is lifetime variable?

921


Describe the syntax of multiple inheritance? When do we use such an inheritance?

1056


how to deploy apache tomcat server to weblogic server in java

2056


Define the term string pool?

972