Question 21
EasyA BankAccount class exposes deposit() and withdraw() but keeps balance private. What does this mainly protect against?
- A.
Code outside the class setting the balance to any value it likes
- B.
Compilation errors
- C.
The class being inherited
- D.
The program running too slowly
Sign up free to see the answer and a step-by-step explanation.