实现一个购买商品后,对数据进行处理统计的功能.
将购买的商品信息保存在Orders类中
public class Orders {
private String name;
private double price;
private int amount;
public Orders(String name, double price, int amount) {
this.name = name;
this.price = price;
this.amount = amount;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getAmount() {
return amount;
}
public void setAmount(int amount) {
this.amount = amount;
}
通过map()处理数据,输出购买每一件商品的总价
public static void main(String[] args)