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 singleton services?
List the features of java programming language.
What are benefits of java?
What do you understand by abstract classes?
How does a for loop work java?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
Is linkedlist thread safe in java?
What is stringwriter?
What is the hashcode () and equals () used for?
Why are global variables used?
What is the difference between equals() and == in java?
Can we sort set in java?
Explain enumeration in java?
What is difference between array and arraylist in java?
What is scope & storage allocation of global and extern variables? Explain with an example