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
?
主要区别是什么?在使用它们并将它们从一个转换为另一个时会遇到什么问题?
最佳答案
字符串是CharSequences,因此您可以只使用字符串而不必担心。 Android只是通过允许您还指定其他CharSequence对象(例如StringBuffers)来尝试提供帮助。