Classwork/Homework:
Answer the following questions:
- What does the author mean by “Objects should be self-governing”?
- What is the “public interface” to an object?
-
Why might a constant be given public visibility?
-
Why is a method invoked through (or on) a particular object? What is the exception to that rule?
-
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? -
Which of the Account class methods would you classify as accessor
methods? As mutator methods? As service methods?
Read up to page 225