Arrays、Collections
来源:互联网 发布:超图软件实施待遇 编辑:程序博客网 时间:2024/05/21 06:50
//仅作为学习笔记
/*Arrays、Collections
*/
/*import java.util.*;class Demo1{ public static void main(String[] args) { int[] arr = {34,45,67,89,12}; // 把数组中的数据转成字符串 String ss = Arrays.toString(arr); System.out.println(ss); //把数组转成集合 String[] array ={"haha","hehe","xixi"}; List list = Arrays.asList(array); System.out.println(list.size());//3 //数组转成的集合不允许进行添加,删除操作,因为数组的长度是固定的 //list.add("huhu");//UnsupportedOperationException //list.remove("haha");//UnsupportedOperationException //为什么要数组转集合? System.out.println(list.contains("hehe")); Iterator ite = list.iterator(); while(ite.hasNext()) { System.out.println(ite.next()); } int[] b = {1,2,3}; List list2 = Arrays.asList(b); System.out.println(list2.size());//1因为集合添加的是引用类型的对象,因为数组是引用类型的,所以把整个数组作为一个对象添加到集合中 System.out.println(list2);//[[I@1b8d6f7] }}*/
0 0
- Arrays、Collections
- Collections&Arrays
- Collections和Arrays
- Collections和Arrays
- 工具类:Collections 、Arrays
- Arrays , Collections , Scanner , Runtime
- 集合—Collections、Arrays
- Map、Collections、Arrays
- Arrays.sort()、Collections.sort()
- day17 Utilities:Collections& Arrays
- Collections与Arrays
- Arrays 和 Collections 排序
- java Arrays/Collections
- Arrays&Collections总结
- Collections,Arrays的排序功能
- 集合工具类 Collections 、Arrays
- Collections和Arrays工具类
- Collections Arrays IO(day19)
- The "Double-Checked Locking is Broken" Declaration
- 本地yum源的配置
- python基础教程共60课-第8课while
- 南大软院二十一天成神计划
- OSX10.11分屏(SplitView)功能的新特性研究(三)
- Arrays、Collections
- 欢迎使用CSDN-markdown编辑器
- LeetCode(292) Nim Game解题报告
- 欢迎使用CSDN-markdown编辑器
- RadioGroup和RadioButton的实现
- 实现Python str.split功能的小函数
- spark中对rdd的几个操作
- static的用法总结
- NYOJ 91 阶乘之和