On Android or Java, what's the difference between a sequence of characters and a string?

For the API (Android SDK API version 8), functions that define the character sequence parameters of a list of names, I can instead pass a String function. Best of all, they work the same way, without the hassle, no warnings.

Is there a difference between the two types? And more importantly, is there an inherent danger if I send a String function instead of a sequence of characters ???

Thanks for any clarification !!!: D

+3
source share
1 answer

Is there a difference between the two types?

. String - , CharSequence - . CharSequence, , , String.

API CharSequence: CharBuffer, Segment, String, StringBuffer, StringBuilder. , String CharSequence , CharSequence.

, , String ???

, . String CharSequence, .

+7

Source: https://habr.com/ru/post/1747727/


All Articles