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 / pradeep rout

public class Test {

public static void main(String args[])
{

String s="java";
System.out.println("Before>>>>>>>"+s);
s=s.replaceAll("j", "k");
System.out.println("After>>>>>>>"+s);


}
}
----------------------Output---------
Before>>>>>>>java
After>>>>>>>kava

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of volatile in java?

1111


What is fail fast in java?

1253


What is the difference between an interface and an abstract class?

1053


What is the use of default method in interface in java?

1049


What's the difference between an abstract class and interface in java?

1087


What is string pool in java?

1073


What is the purpose of lambda expressions?

1111


Why do we use bufferedreader?

1051


What is java console application?

1067


What is empty string literal in java?

1108


What is the difference between logical data independence and physical data independence?

1088


Can we call the constructor of a class more than once for an object?

1140


Explain the features of interfaces in java?

1034


What is difference between final and finally in java?

1145


What do you understand by the term polymorphism?

1132