创建一Pai类包含属性 价格 int price 材料 String cl 包含52张 扑克的集合 ListPuke pks ; 1 定义方法 comparePriceTo可以与其他另一副牌比较价格返回差 价
public class Pai {
private int price;
private String cl;
private List
public Pai(int price, String cl, List<Puke> pks) {
this.price = price;
this.cl = cl;
this.pks = pks;
}
public int comparePriceTo(Pai other) {
return this.price - other.price;
}
//getter and setter methods
}
原文地址: https://www.cveoy.top/t/topic/fx56 著作权归作者所有。请勿转载和采集!