Chapter 4: Lessons Questions Part 3

Classwork/Homework:
Answer the following questions:

  1. What does the author mean by “Objects should be self-governing”?

  2. What is the “public interface” to an object?

  3. Why might a constant be given public visibility?

  4. Why is a method invoked through (or on) a particular object? What is the exception to that rule?

  5. In the Banking program:
    a. How many Account objects are created?
    b. How many arguments (actual parameters) are passed to the
    withdraw method when it is invoked on the acct2 object?
    c. How many arguments (actual parameters) are passed to the
    addInterest method when it is invoked on the acct3 object?

  6. Which of the Account class methods would you classify as accessor
    methods? As mutator methods? As service methods?

Read up to page 225