String对象不可改变
String的初始化方式
1. 匿名对象:自动入池
2. 使用new关键字:创建新的对象
常用方法
1. 字符数组:toCharArray()
2. 字节数组:getBytes()
3. 比较:equals(), compareTo()
4. 查找:contains(), indexOf(), lastIndexOf, startsWith(), endsWith()
5. 替换:replace(), replaceFirst(), replaceAll()
6. 截取:subString()
7. 拆分:split()
8. 类型转换:valueOf(Object obj)
9. 其他:length(), trim(), isEmpty(), intern(), toLowerCase(), toUpperCase()