Java 类设计:Pai 类,包含价格比较方法
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/oir1 著作权归作者所有。请勿转载和采集!