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 is the importance of static variable?
Explain the difference between abstract class and interface in java?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
How many bytes is a char in java?
What is skeleton and stub? What is the purpose of those?
How do you read a char in java?
Tell us something about different types of casting?
Which variable is the independent variable?
Is null an object in java?
Difference between java and javascript
Explain about data types?
What is nested class?
What are jee technologies?
Differentiate between a class and an object.
What is space character in java?