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 are singleton services?

886


List the features of java programming language.

1031


What are benefits of java?

1046


What do you understand by abstract classes?

1062


How does a for loop work java?

1032


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

1106


Is linkedlist thread safe in java?

991


What is stringwriter?

953


What is the hashcode () and equals () used for?

1026


Why are global variables used?

1015


What is the difference between equals() and == in java?

968


Can we sort set in java?

948


Explain enumeration in java?

1001


What is difference between array and arraylist in java?

988


What is scope & storage allocation of global and extern variables? Explain with an example

1035