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