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

Explain when noclassdeffounderror will be raised ?

1052


What happens when a thrown exception is not handled?

1114


What is data type example?

960


How do you compare values in java?

1030


What type of language is java?

999


How does java pattern compile work?

963


Is java free for commercial?

922


When should I use a singleton?

1049


Why are the methods of the math class static?

1075


Difference between keyword and identifier.

1028


Does sprintf add a null terminator?

1099


What is the SimpleTimeZone class?

2277


What is the purpose of the runtime class in java programming?

1060


What does flag mean in java?

1021


Why is the singleton pattern considered to be an anti pattern?

886