Charsequence and string in Android

Source: Internet
Author: User

The String class represents strings. All string literals (such as "ABC") in a Java program are implemented as instances of this class.

(This is not much to understand, often using class)
Public interface Charsequence {
public int length ();
public char charAt (int index);
Public charsequence subsequence (int start, int end);
Public String toString ();
}

Public final class String implements Serializable, comparable, charsequence {
Xxxxxx
}
String inside the method a lot of will not write, should be able to see different.
This is an interface: in JDK1.4, the introduction of the Charsequence interface, the implementation of this interface class has: Charbuffer, String, StringBuffer, StringBuilder this four class.

Charbuffer is a class used in NiO, string implements this interface for granted, StringBuffer is also a charsequence,stringbuilder Java is a class that plagiarism C #, The basic and StringBuffer classes are as efficient as they are, but they are not guaranteed to be thread-safe and can be considered in environments that do not require multi-threading.

Charsequence and string

in Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.