package cn.zxg.PackgeUse; /** * 测试StringBuilder,StringBuffer可变字符序列 */ public class TestStringBuilder { public static void main(String[] args) { String str; //StringBuilder 线程不安全,效率高(一般使用它) //StringBuffer 线程安全,效率低 StringBuilder sb=new StringBuilder("abcdf"); StringBuffer sb1=new StringBuffer(); System.out.println(Integer.toHexString(sb.hashCode())); } }