- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
ArrayList数组及其用法(ArrayList array and its usage)
ArrayList数组及其用法(ArrayList array and its usage)
System. The Collections. The ArrayList class is a special array. By adding and removing elements, you can dynamically change the length of the array.
Advantages of a.
1. Support for automatic resizing
2. You can insert elements flexibly
3. You can delete elements flexibly
Two. Limitations
Its a little slower than the usual array
Three. Add elements
1. PublicvirtualintAdd (objectvalue);
Add the object to the end of the ArrayList
ArrayListaList = newArrayList ();
AList. Add ( a );
AList. Add ( b );
AList. Add ( c );
AList. Add ( d );
AList. Add ( e );
Content is abcde
2. PublicvirtualvoidInsert (intindex objectvalue);
Inserts the element into the specified index of the ArrayList
ArrayListaList = newArrayList ();
AList. Add ( a );
AList. Add ( b );
AList. Add ( c );
AList. Add ( d );
AList. Add ( e );
AList. Insert (0, aa);
The results for aaabcde
3. PublicvirtualvoidInsertRange (intindex ICollectionc);
Inserts an element of the collection into the specified index of the ArrayList
ArrayListaList = newArrayList ();
AList. Add ( a );
AList. Add ( b );
AList. Add ( c );
AList. Add ( d );
AList. Add ( e );
ArrayListlist2 = newArrayList ();
List2. Add ( tt );
List2. Add ( TTT );
AList. InsertRange (2, list2);
The results for abtttttcde
4. Remove
A) publicvirtualvoidRemove (objectobj);
Removing the first match from a specific object from the ArrayList is the first one
ArrayListaList = newArrayList ();
AList. Add ( a );
AList. Add ( b );
AList. Add ( c );
AList. Add ( d );
AList. Add ( e );
AList. Remove ( a );
The results for bcde
2. PublicvirtualvoidRemoveAt (intindex);
Removes the element at the specified index of the ArrayList
AList. Add ( a );
AList. Add ( b );
AList. Add ( c );
AList. Add ( d );
AList. Add ( e );
AList. RemoveAt (0);
The results for bcde
3. PublicvirtualvoidRemoveRange (intindex intcount);
Removes a range of elements from the ArrayList. Index means Index, and count means the number that starts at the Index
您可能关注的文档
- 2009年上海高考化学试卷--真题(2009 Shanghai college entrance exam chemistry paper - the real question).doc
- 2009年建设节约型机关工作计划(In 2009, we will build a working plan for the construction of energy-saving institutions).doc
- 2009年普通高等学校夏季招生考试(上海卷)(2009 summer recruitment examination (Shanghai)).doc
- 材料力学视频教学(全62集)--天津大学(Materials mechanics video teaching (all 62) - tianjin university).doc
- 材料加工(Material processing).doc
- 材料成型工艺基础(Foundation of material forming process).doc
- 材料科学基础名词解释(Basic terms of material science).doc
- 材质合金 款式时尚夸张,很具现代感,适合派对,泡吧 这么便宜的价格(Material the alloy style is fashionable exaggerated, very contemporary sense, suit party, bubble bar so cheap price).doc
- 标点符号用法(punctuation).doc
- 标点练习(Punctuation practice).doc
- ARM开发之一种DWT域基于IFS的数字水印算法(An ARM development of a DWT domain based on IFS digital watermarking algorithm).doc
- ASCII码和焦点的获取(Access to ASCII and focus).doc
- asdassadsad(asdassadsad).doc
- asx文件解释(Asx document interpretation).doc
- ass速算法(Along simplified method).doc
- ATMEGA8的熔丝位说明(The fuse bit description of ATMEGA8).doc
- at89c51单片机对应高低电平的电压值(The at89c51 unit corresponds to the voltage of the high and low level).doc
- at89c51电路(At89c51 circuit).doc
- AutoCAD 2002 完全使用手册(DOC) ch16_ok(AutoCAD 2002 complete use manual (DOC) ch16_ok).doc
- autocad三维转二维方法(Autocad 3d transformation method).doc
文档评论(0)