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
Why is whitespace important?
What is final?
How can we pass argument to a function by reference instead of pass by value?
Can classes declared using the abstract keyword cab be instantiated?
What is the purpose of encapsulation?
How do you control extraneous variables?
Which is fastest collection in java?
What is sorting in java?
Can bool be null?
What is a ternary operator in java? What is an interface?
Can we sort arraylist in java?
Why are there no global variables in java?
What is codebase?
Can we have more than one package statement in source file ?
Difference between this() and super() in java ?