String不可变。String 是引用类型数据,其值是无法改变,如果想要像C语言那样修改字符串那么只能通过...
//方法一 StringBuffer aaBuffer =new StringBuffer("123");aaBuffer.replace(0, aaBuffer.length(), "456");System.out.println(aaBuffer.toString());//方法二 StringBuffer bbBuffer =new StringBuffer("123");bbBuffer.delete(0,aaBuffer.length());bbBuffer.append("456");System.out.pri...