我有這個類繼承收集
public class Room{
private int n_bed;
private float cost;
private Collection<Client> clientlist;
public Room(int n,float c){
n_bed = n;
cost = c;
clientlist = new ArrayList<Client>();
}
}
這個類從上面的類繼承
public class RoomWithBar extends Room{
private Collection<Drink> drinkslist;
public RoomWithBar(int n,float cost){
super(n,cost);
drinkslist = new ArrayList<Drink>();
}
public Collection<Drink> getDrinksList(){
return drinkslist;
}
public void addDrink(Drink drink){
drinkslist.add(drink)
}
}
我的問題是:我也必須插入類RoomWithBar或集合的集合客戶端列表自動繼承?