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 volatile in java?
What is fail fast in java?
What is the difference between an interface and an abstract class?
What is the use of default method in interface in java?
What's the difference between an abstract class and interface in java?
What is string pool in java?
What is the purpose of lambda expressions?
Why do we use bufferedreader?
What is java console application?
What is empty string literal in java?
What is the difference between logical data independence and physical data independence?
Can we call the constructor of a class more than once for an object?
Explain the features of interfaces in java?
What is difference between final and finally in java?
What do you understand by the term polymorphism?