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 a java applet? What is an interface?

1089


What is a class variable?

1033


What is constructor and its types?

1140


Is main a function?

1047


Is java type safe?

955


What is byte data type?

992


How many types of methods are there?

1044


What is the difference between a scrollbar and a scrollpane?

1049


What do you mean by scope of variable?

886


What is replacefirst in java?

1100


what is aggregation in java?

1005


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

1330


Give some features of interface?

1065


How does java pattern compile work?

958


You're given a Boolean 2D matrix, can you find the number of islands?

1094