public class Program { public static void main(String[] args) { String A = new String("java"); StringBuffer B = new StringBuffer("java"); st(A); sb(B); System.out.println(A); System.out.println(B); } public static void st(String st) { st.replace("j", "1"); } public static void sb(StringBuffer sb) { sb.append("c"); } } System.out.println(A)的输出结果是: System.out.println(B)的输出结果是: