Reputation: 15052
As per the API, the getText()
method of EditText
returns Editable
. What was the purpose of it? It could simply have been a String
return type?
And as per the Editable
API:
This is the interface for text whose content and markup can be changed (as opposed to immutable text like Strings).
To achieve immutable functionality, why not use StringBuilder
or StringBuffer
instead?
Upvotes: 1
Views: 115
Reputation: 86948
public interface Editable implements GetChars, Spannable, Appendable, CharSequence
Amoung other features, Editable retains Spannable data which Strings and StringBuilders cannot do.
Upvotes: 5