public class Pai { private int price; private String cl; private List pks;

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

}

Java 类设计:Pai 类,包含价格比较方法

原文地址: https://www.cveoy.top/t/topic/oir1 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录