日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CharSequence类

發布時間:2023/12/20 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CharSequence类 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
CharSequence是char類型的一個可讀序列,它本身是一個接口,CharBuffer、String、StringBuffer、StringBuilder這個四個類
實現了這個接口。此接口對于不同種類的char序列提供統一的只讀訪問

以下是這個函數的API 它只定義了四個方法

/*** This interface represents an ordered set of characters and defines the* methods to probe them.*/ public interface CharSequence {/*** Returns the number of characters in this sequence.** @return the number of characters.*/public int length();/*** Returns the character at the specified index, with the first character* having index zero.** @param index* the index of the character to return.* @return the requested character.* @throws IndexOutOfBoundsException* if {@code index < 0} or {@code index} is greater than the* length of this sequence.*/public char charAt(int index);/*** Returns a {@code CharSequence} from the {@code start} index (inclusive)* to the {@code end} index (exclusive) of this sequence.** @param start* the start offset of the sub-sequence. It is inclusive, that* is, the index of the first character that is included in the* sub-sequence.* @param end* the end offset of the sub-sequence. It is exclusive, that is,* the index of the first character after those that are included* in the sub-sequence* @return the requested sub-sequence.* @throws IndexOutOfBoundsException* if {@code start < 0}, {@code end < 0}, {@code start > end},* or if {@code start} or {@code end} are greater than the* length of this sequence.*/public CharSequence subSequence(int start, int end);/*** Returns a string with the same characters in the same order as in this* sequence.** @return a string based on this sequence.*/public String toString(); }

總結

以上是生活随笔為你收集整理的CharSequence类的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。