摘要: 1、使用容器存储对象,并重写Comparable接口,使用Collections类的静态方法对容器进行处理.package javaTest;import java.util.*;import static java.lang.System.out;public class Hello implements Comparable { public int i=0; public Hello(int i){ this.i=i; } //实现Comparable接口 public int compareTo(Hello h){ ... 阅读全文
posted @ 2013-12-13 16:23 iyjhabc 阅读(181) 评论(0) 推荐(0) 编辑