How is
String passed in method call(ref or value)??
Kindly explain me the below program output
public class Test{
public static void main(String [] args) {
String textString = new String ("java");
StringBuffer textBuffer = new StringBuffer ("java");
stringReplace (textString);
bufferReplace (textBuffer);
System.out.println (textString + textBuffer);
}
public static void stringReplace (String text) {
text = text.replace ('j' , 'i');
//System.out.println(text);
}
public static void bufferReplace (StringBuffer text) {
text = text.append ("C");
//System.out.println(text);
}
}
output is javajavac