// add a field to specify an object that ButtonPressed() will first visit public PurchaseButton(Economy economy, int index) { _economy = economy; _index = index; }
// add a field to specify an object that Button Pressed will visit // replace the following default constructor with a constructor that takes // an object to be set to the above field public CoinReturnButton(Economy economy) { _economy = economy; }
// rewrite the following constructor with a constructor that takes an object // to be set to the above field public CoinInserter(Economy economy, int index) { _index = index; _economy = economy; }