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
Can you explain the usages of class.forname()?
What is map and hashmap in java?
What state does a thread enter when it terminates its processing in java programming?
How to restrict a member of a class from inheriting by its sub classes?
How we can execute any code even before main method?
What is linked hashmap and its features?
What is multithreading and its advantages?
What is data object example?
Difference between object instantiation and construction ?
Why is it called buffering?
What is difference between final and immutable?
How many bits are in a sentence?
how to prepare for IT Officers Interview in Banks
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?