1.String 2.Stringbuffer 3.StringBuilder 4.三者之间的区别 5.使用策略 1.String public final class String implements java.io.Serializable, Comparable<String>, CharSequence { /** The value is used for character storage. */ private final char value[]; } 首先String是fi…
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. * 字符串是不变的,他们的值在创造后不能改变. * 字符串缓冲区支持可变字符串,因为字符串对象是不可变的,所以它们可…
Java提供两种不同的类型:引用类型和原始类型(内置类型).Int是java的原始数据类型,Integer是java为int提供的封装类. Java为每个原始数据类型提供了封装类. 其中原始数据类型封装类有 boolean --> Boolean c har --> Character byte --> Byte short --> Short int --> Integer long --> Long float --> Float double -->…