OOP IB Classes Vs Objects
OOP IB Classes Vs Objects
By Ms Mirza
HumanBeing1.java
KEY TERMINOLOGY
Local
variables
Encapsulation
1. Customers just walk into the safe and either leave or take money. No record is
kept. We rely on a)people's honesty and that b)they never make a mistake. We
can also never check who has taken what or when. That is equivalent to
allowing public access to a variable. E.g. bankBalance.
2. If a customer wants to withdraw or access money, they go to one of two
different bank tellers and fill out a form. The bank worker will stop them taking
out more than they have, and will definitely record the transaction. The bank
teller will check for mistakes in everything. That is equivalent to having a
mutator and accessor(getter and setter) and a private bankBalnce.
Why hide data?
Task - Create an employee class
Accessors and Mutators