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
What are the restrictions imposed on method overriding?
Why there is no call by reference in java?
What is a arraylist in java?
Is null keyword in java?
What does those terms actually mean included in the j.d.k i.6?
List out five keywords related to exception handling ?
Is an integer an object?
What is close method? How it's different from Finalize & Dispose?
Explain how can you debug the Java code?
Explain the importance of throws keyword in java?
When do you call copy constructor?
What is a for loop in java?
How do I stop concurrentmodificationexception?
What is bifunction in java?
What are different types of states exist for a thread?