The difference between CharSequence and String in Java
CharSequence is an interface that represents a sequence of characters. Mutability is not enforced by this interface. Therefore, both mutable and immutable classes implement this interface.
String is a sequence of characters in Java. It is an immutable class and one of the most frequently used types in Java. This class implements the CharSequence, Serializable, and Comparable interfaces.
Since String is immutable every operation on it will create a new String for example
String test = "a";
test = test + "B";
in this scenario you've created two different string
if you use StringBuffer StringBuilder because they 're both mutable, in this case you're creating only one instance
StringBuilder test = new StringBuilder("a");
test.append("B");
you can choose CharSequence just means you can choose CharBuffer, Segment, StringBuffer, StringBuilder.