|
Do you want to keep hackers out of your checking account? A good answer might be:Yes. | |
The private Visibility ModifierWhen a member of a class is declared private it can be used only by the methods of that class. Here is the checking account class definition from the last chapter with each of its variables declared to be private.
Now only the methods of a CheckingAccount object can "see" the values in accountNumber, accountHolder, and balance. | |
QUESTION 2:It is useless to have a checking account if the balance cannot be changed. How can an application program (such as main()) change the balance of a CheckingAccount object? Click Here after you have answered the question |