
java基础_集合
烦到困
学习的痛苦......是终生的
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
遍历集合的三种方式
遍历集合的三种方式for(){}public class ArrayListTest2 { public static void main(String[] args) { // TODO Auto-generated method stub // 不能实例化List的对象 // ArrayList 允许重复的对象 ...原创 2018-11-13 15:37:48 · 191 阅读 · 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 · 692 阅读 · 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 · 798 阅读 · 0 评论