people.java

来自「这个是一个java应用程序」· Java 代码 · 共 33 行

JAVA
33
字号
import java.io.*;
public class People implements Serializable,Comparable{
   String name=null;
   int time=0;       
   int count=0;                   
   public People(String name,int t,int count){
       this.name=name;
       time=t;
       this.count=count;
   }
   public int getTime(){
       return time;
   }
   public String getName(){
       return name;
   }
   public int getCount(){
	return count;
   }
   public int compareTo(Object b){
  /*     People p=(People)b;
       if((this.time-p.time)==0)
         return 1;
       else
         return (this.time-p.time);
*/
	People p=(People)b;
	if((this.count-p.count)==0)
		return 1;
	else
	return (this.count-p.count);
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?