|
An Introduction to Information Hiding
with Examples in Java |
|
Prof. David Bernstein
|
| Computer Science Department |
| bernstdh@jmu.edu |
toString() methodequals() and/or compareTo() method
PictureFrame class with public
attributes to someone they could use it improperly
get
(and are sometimes called "getters")set
(and are sometimes called "setters")
PictureFrame class
should be able to change the way the cost is calculated
without it having any impact on a user of the
class
calculateArea()
has been renamed getVisibleArea() because there
is no reason for the user to know whether the area is
an attribute or a calulcated value)
PictureFrame Class
PictureFrame Class
toString() methodequals() and/or compareTo() method