- class ComByLen implements Comparator<String>
- {
- public int compare(String s1,String s2){
- int temp=s1.length()-s2.length();
- return temp==0?s1.compareTo(s2):temp;
-
- }
- }
- class ComByLen<String> implements Comparator<String>
- {
- public int compare(String s1,String s2){
- int temp=s1.length()-s2.length();
- return temp==0?s1.compareTo(s2):temp;
-
- }
- }
- 下面的代码会出现问题,请问是什么原因?
复制代码 |
|