标签:思想 1.2 重载 div table png collect 简化 ble
Employee
类,在test2包中新建一个Test
类,并在其main中新建test1包中的Employee的对象,然后使用clone方法克隆一个新对象,能否成功?为什么?clone
方法是被protected
修饰的,只能在包内被访问。Collections.sort(personSortable,(PersonSortable o1,PersonSortable o2)->{if(o1.getAge()>=o2.getAge()){ return 1; } else{ return -1; } });
shapeComparator
所指向的对象与Comparator
接口有什么关系?Comparator<Shape> shapeComparator = new Comparator<Shape>() { @Override public int compare(Shape o1, Shape o2) { //你的代码 } };
IntegerStack
相应的方法来说,定义IntegerStack
接口,然后定义其实现类这种方式有什么好处?IntegerStack
接口能够使我们程序的创建新类,实现接口中的方法是能够具体对于该类是什么对象然后进行判定使其具体实现。Collections.sort
对引用类型数组进行排序需要有一个什么前提条件?Collection.sort
实现Comparable接口或者Comparator接口,需要对其方法全部实现。
PersonTest.java
中哪里体现了多态?
周次 | 总代码量 | 新增代码量 | 总文件数 | 新增文件数 |
---|---|---|---|---|
1 | 0 | 0 | 0 | 0 |
2 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | 0 | 0 |
4 | 437 | 437 | 7 | 7 |
5 | 905 | 468 | 13 | 6 |
6 | 1294 | 389 | 21 | 8 |
标签:思想 1.2 重载 div table png collect 简化 ble
原文地址:http://www.cnblogs.com/wenzun/p/7746521.html