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 is the use of set in java?
How can we create an immutable class in java?
How does finally block differ from finalize() method?
How do I know if java is installed?
What is the advantage of OOP in java?
What is the differences between c++ and java? Explain
how does the run() method in runnable work? : Java thread
How is garbage collection controlled?
Explain about serializable interface in java?
What are the types of relation?
Why do we need wrapper class?
What is a loop java?
What is the difference between the font and fontmetrics classes in java programming?
Can extern variables be initialized?
Can you have two constructors in java?