摘要: Java中字符串的不变性 String 对象创建后则不能被修改,是不可变的,所谓的修改其实是创建了新的对象,所指向的内存空间不同。 String s1 = "test"; String s2 = "test"; //定义字符串s3,保存“this is a ”和s1拼接后的内容 String s3 阅读全文
posted @ 2016-06-14 17:29 sinpi 阅读(206) 评论(0) 推荐(0)