/* * 关于equals()和==: 对于String简单来说就是比较两字符串的Unicode序列是否相当,如果相等返回true; * 而==是比较两字符串的地址是否相同,也就是是否是同一个字符串的引用. * * 为了高效的修改字符串Java引入了StringBuffer. */public class test { public static void main(String[] args) { String x = "paopao"; String y = new String(…
1.String: /** Strings are constant; their values cannot be changed after they * are created. String buffers support mutable strings. * Because String objects are immutable they can be shared. * 字符串是不变的,他们的值在创造后不能改变. * 字符串缓冲区支持可变字符串,因为字符串对象是不可变的,所以它们可…
1. 拼接结果如下的字符串 1,2,3,4,5,6,7,8,9,10,11,12,12,12,12,34,234,2134,1234,1324,1234,123 2. 以前是这样想的,但是从效率,速度的方面来说这样做是低效率的 public class StringTest { public static void main(String[] args) { StringBuilder sb = new StringBuilder(); for (…