举一个通俗的例子,购买衣服、电器、首饰 首先建立相应的物品类 //衣服类 public class Clothing { public Clothing getClothing() { return Clothing; } } //电器类 public class Ele { public Ele getEle() { return Ele; } } //首饰类 public class Jewelry { public Jewelry getJewelr ...