HiveBrain v1.2.0
Get Started
← Back to all entries
principlejavaCritical

CharSequence VS String in Java?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
stringcharsequencejava

Problem

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?

Solution

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.

Context

Stack Overflow Q#1049228, score: 364

Revisions (0)

No revisions yet.