s-day04--斗地主案例2

This commit is contained in:
xx
2026-10-15 16:06:38 +08:00
parent f78cc2d201
commit e100986e73
2 changed files with 105 additions and 0 deletions
+21
View File
@@ -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;
}
}