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 the two types of streams offered by java 8?

512


What is a type parameter in java?

532


Can I overload to string method

966


Is ruby built on java?

533


Why vector is used in java?

558






Why string is not thread safe?

543


What is object cloning in Java?

636


Explain about map interface in java?

595


Which is easier netbeans or eclipse?

610


Is java a compiler?

567


When should I use singleton?

521


What is unicode with example?

614


How will you reverse a link list without using recursion?

597


What are serialization and deserialization?

728


What is navigable map in java?

525