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 / vikneswarank
String s="java";
s.repalce('j','k');
System.out.println(s);
output is: java
because String is immutable.we cannt change of string
content.suppose u have to write
s=s.repalce('j','k');
output is :kava
| Is This Answer Correct ? | 24 Yes | 3 No |
Post New Answer View All Answers
Can variables be used in java without initialization?
What is string manipulation?
Explain the term virtual machine?
Why is String immutable?
Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?
What does n mean in java?
What is default size of arraylist in java?
Can I use % with real numbers?
What are design patterns and please explain?
If A Class Is Declared Without Any Access Modifiers, Where May The Class Be Accessed?
Tell me about different OOPS concepts.
What is the difference between comparison done by equals method and == operator?
What is a protected method?
What does @param args mean in java?
Is there any tag in htm to upload and download files?