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 is the importance of static variable?

1115


Explain the difference between abstract class and interface in java?

983


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

972


How many bytes is a char in java?

1020


What is skeleton and stub? What is the purpose of those?

1124


How do you read a char in java?

1022


Tell us something about different types of casting?

921


Which variable is the independent variable?

981


Is null an object in java?

1032


Difference between java and javascript

1092


Explain about data types?

1085


What is nested class?

999


What are jee technologies?

1011


Differentiate between a class and an object.

1029


What is space character in java?

1103