public class Test {
public static void stringReplace(String input) { input = input.replace('j', 'c');
}
public static void stringBufferReplace(StringBuffer input) {
input = input.append("c"); }
public static void main(String args[]) {
String testString = "java";
StringBuffer testStringBuffer = new StringBuffer("java");
stringReplace(testString);
stringBufferReplace(testStringBuffer);
// testString=testString.replace('j', 'c');//得要这样
System.out.println(testString + testStringBuffer); }
}