Day14## 知识点总结
1、集合
2、框架
Collection(接口) :List(接口) Set(接口) :ArrayList LinkedList TreeSet HashSet : Stack Queue
Map(接口): TreeMap HashTable HashMap
3,ArrayList应用与底层实现
4,排序(3)
(1)a.add(a);
Collections.sort(a);
(2)public class MySort implements Comparator {
@Override
public int compare(Object o1, Object o2) {
Student s1 = (Student)o1;
Student s2 = (Student)o2;
if(s1.getScore()>s2.getScore()){
return -1;
}else if(s1.getScore()<s2.getScore()){
return 1;
}
return 0;
}
}
(3) public int compareTo(Object o) {
Student s = (Student)o;
if(this.age>s.age){
return -1;
}else if(this.score<s.score){
return 1;
}
return 0;
}