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
What are the core java topics?
Name few java.lang classes introduced with java 8 ?
What is a databasemetadata?
What do you understand by copy constructor in java?
What is the difference between C++ and Java and your preferences?
In a class implementing an interface, can we change the value of any variable defined in the interface?
What one should take care of, while serializing the object?
Is string thread safe in java?
What is arraylist e in java?
Which is better 64 bit or 32 bit?
How do you compare objects in java?
How do you escape a string?
What are 3 boolean operators?
What is the constructor?
Explain different ways of creating a thread. Which one would you prefer and why?