Java Comparator

时间:2014-05-05 23:32:10   收藏:0   阅读:444
bubuko.com,布布扣
1 Arrays.sort(points, new comparator());
2 
3 public static class comparator implements Comparator<Point> {
4     public int compare(Point p1, Point p2) {
5     return p1.x - p2.x;
6 }
bubuko.com,布布扣

 

Java Comparator,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!