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?
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