CharSequence VS String in Java?

e-satis picture e-satis · Jun 26, 2009 · Viewed 124k times · Source

Programming in Android, most of the text values are expected in CharSequence.

Why is that? What is the benefit, and what are the main impacts of using CharSequence over String?

What are the main differences, and what issues are expected, while using them, and converting from one to another?

Answer

Zarkonnen picture Zarkonnen · Jun 26, 2009

Strings are CharSequences, so you can just use Strings and not worry. Android is merely trying to be helpful by allowing you to also specify other CharSequence objects, like StringBuffers.