M.13. Class ATMCaseStudy

Class ATMCaseStudy (Fig. M.12) is a simple class that allows us to start, or “turn on,” the ATM and test the implementation of our ATM system model. Class ATMCaseStudy’s main method (lines 7–11) does nothing more than instantiate a new ATM object named theATM (line 9) and invoke its run method (line 10) to start the ATM.

Figure M.12. ATMCaseStudy.java starts the ATM.
 1  // ATMCaseStudy.java
 2  // Driver program for the ATM case study
 3
 4  public class ATMCaseStudy
 5  {
 6     // main method creates and runs the ATM
 7     public static void main( String[] args )
 8     {
 9        ATM theATM = new ATM();
10         theATM.run();
11      } // end main
12   } // end class ATMCaseStudy

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.