![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java基础_集合
烦到困
学习的痛苦......是终生的
展开
-
遍历集合的三种方式
遍历集合的三种方式for(){}public class ArrayListTest2 { public static void main(String[] args) { // TODO Auto-generated method stub // 不能实例化List的对象 // ArrayList 允许重复的对象 ...原创 2018-11-13 15:37:48 · 153 阅读 · 0 评论 -
List的删除
使用List的remove方式public class ArrayListTest2 { public static void main(String[] args) { // TODO Auto-generated method stub // 不能实例化List的对象 // ArrayList 允许重复的对象 ...原创 2018-11-13 16:18:58 · 620 阅读 · 1 评论 -
更改TreeSet的排序方式
TreeSet 的排序方式一让元素本身具有比较性,需要实现Comparable接口覆盖compareTo方法class Student implements Comparable{ //重写compareto方法进行排序 int age; String name; Student(String name,int age){ this.name=name; this...原创 2018-12-04 16:48:46 · 737 阅读 · 0 评论