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 / puneet
No, the strings are immutable; the value of s will be the
same but new object kava will get crated which wil have no
refrence. s will refer to the same object which is not
changed.
s=s.replace("",""); should have worked...otherways
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What are local variables?
Can we catch more than one exception in a single catch block?
What is fail fast in java?
What are the super most classes for all the streams?
What is the base class of all classes?
What is the purpose of the wait(), notify(), and notifyall() methods in java programming?
How are variables stored?
What is finally in Java?
what is the significance of listiterator in java?
What is the difference between conversation & casting?
Is 0 an irrational number?
What is lifetime variable?
Describe the syntax of multiple inheritance? When do we use such an inheritance?
how to deploy apache tomcat server to weblogic server in java
Define the term string pool?