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 / vikneswarank

String s="java";
s.repalce('j','k');

System.out.println(s);

output is: java
because String is immutable.we cannt change of string
content.suppose u have to write
s=s.repalce('j','k');

output is :kava

Is This Answer Correct ?    24 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can variables be used in java without initialization?

1071


What is string manipulation?

995


Explain the term virtual machine?

1039


Why is String immutable?

1048


Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?

1019


What does n mean in java?

963


What is default size of arraylist in java?

1142


Can I use % with real numbers?

1017


What are design patterns and please explain?

1079


If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?

1171


Tell me about different OOPS concepts.

993


What is the difference between comparison done by equals method and == operator?

1020


What is a protected method?

1134


What does @param args mean in java?

1051


Is there any tag in htm to upload and download files?

1042