姬長信(Redy)

CharSequence和java之间的确切区别


参见英文答案 > CharSequence VS String in Java?????????????????????????????????????9个
>????????????Why StringBuilder when there is String?????????????????????????????????????9个
>????????????Choosing between CharSequence and String for an API ????????????????????????????????????1个
我读了这个previous post.可以有人说CharSequence和String之间的确切区别是什么,除了String实现CharSequence并且String是一个字符序列的事实?例如:
CharSequence obj = "hello";
String str = "hello";
System.out.println("output is : " + obj + "  " + str);

将“hello”分配给obj并再次分配给str时会发生什么?