我有一个股票列表作为一个类,然后是一个具有下面显示的构造函数的商店类。商店有一个链接到股票类的数组列表。在构造函数中使用Arraylist
我如何访问某个商店的数组列表?
E.G.如果我选择店铺argos,我想要它所有的库存。每家店都有自己的股票
public Store(int storeId, String name, String location){
this.storeId = storeId;
this.name = name;
this.location = location;
items = new ArrayList<Stock>();
}
一个私有的局部变量,一个getter? – Keppil 2013-05-01 14:16:38