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 rule of accessibility in java?
What is basic syntax?
What is the purpose of java?
What is the mapping mechanism used by java to identify IDL language?
What is map and hashmap in java?
Which variable is the independent variable?
What is the purpose of the system class in java programming?
Define how objects are stored in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
What is the differences between heap and stack memory in java? Explain
What is scanner in java?
What does the “static” keyword mean?
What are the features of junit?
How can I become a good programmer?
What is the use of singleton class?