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
Explain when noclassdeffounderror will be raised ?
What happens when a thrown exception is not handled?
What is data type example?
How do you compare values in java?
What type of language is java?
How does java pattern compile work?
Is java free for commercial?
When should I use a singleton?
Why are the methods of the math class static?
Difference between keyword and identifier.
Does sprintf add a null terminator?
What is the SimpleTimeZone class?
What is the purpose of the runtime class in java programming?
What does flag mean in java?
Why is the singleton pattern considered to be an anti pattern?