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 does java ide mean?

631


What is derived datatype?

621


What is multithreading in java?

541


What is bigger kb or mb?

577


How can you share data between two thread in Java?

518






If we don’t want some of the fields not to serialize how to do that?

559


Why stringbuilder is not thread safe?

533


Where are global variables stored?

502


What are packages in java?

557


What is return type in java?

628


Justify your answer that you can't define a method inside another method in java, if you can then how?

597


What is a double vs float?

530


how to open and edit XML file in Weblogic???

1541


What is a java developer salary?

536


Can a string be null?

536