s-day04--斗地主案例2
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.inmind.map01;
|
||||
|
||||
public class Poker implements Comparable<Poker>{
|
||||
String pokerName;//牌面
|
||||
int index;//牌的索引,用来排序
|
||||
|
||||
public Poker(String pokerName, int index) {
|
||||
this.pokerName = pokerName;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.pokerName+" ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Poker o) {
|
||||
return this.index - o.index;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user