写一个生产管理系统需要考虑许多因素,这里仅给出一个简单的示例代码。
首先,需要定义一个生产物品的类,例如:
class Product {
private String name;
private int quantity;
public Product(String name, int quantity) {
this.name = name;
this.quantity = quantity;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
}