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
When should a function throw an exception?
What is the difference between size and length in java?
What are heterogeneous objects?
Why main method is static in java?
Why we override equals() method?
What is mutable object and immutable object?
Which sorting is best in java?
Which package is always imported by default?
What is the purpose of lambda expressions?
Is treeset sorted in java?
Which is the best approach for creating thread ?
What is ellipsis in java?
Write a program to reverse array in place?
What is an empirical question?
What does singleton class mean?