O'Reilly logo

Java™ How to Program, Seventh Edition by P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

M.11. Class Withdrawal

Class Withdrawal (Fig. M.10) extends Transaction and represents a withdrawal ATM transaction. This class expands upon the “skeleton” code for this class developed in Fig. 10.24. Recall from the class diagram of Fig. 10.21 that class Withdrawal has one attribute, amount, which line 6 implements as an int field. Figure 10.21 models associations between class Withdrawal and classes Keypad and CashDispenser, for which lines 7–8 implement reference-type attributes keypad and cashDispenser, respectively. Line 11 declares a constant corresponding to the cancel menu option. We will soon discuss how the class uses this constant.

Figure M.10. Class Withdrawal represents a withdrawal ATM transaction.
 1 // Withdrawal.java
 2 // Represents ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required