?? players.java
字號:
package diamonds3;
import java.util.Comparator;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Players {
String name;
int result;
public Players() {
name="NoName";
result=0;
}
public void set(String str,int r)
{
name= str;
result=r;
}
public void set(Players p)
{
name= p.name;
result=p.result;
}
public int compareTo( Players p2) {
if (this.result != p2.result)
return this.result - p2.result;
else
return this.name.compareTo(p2.name);
}
public String toString()
{
String str=new String();
str+=this.name;
while(str.length()<18)
{
str+=" ";
}
str+=" "+this.result;
return str;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -