Okay, there is one final feature of
objects that you need to understand.
Objects are smart enough to be
dynamic. Specifically, they have the ability to react
differently depending on the situation.
This is important because it makes
the API dependable and easy to understand for the incoming
developer.
Let's look at an example. Suppose
you have a method called "print()".
The first question you might ask
is, "what does this method print: pictures, text, or
what?"
Well using
"polymorphism", an object can be made to handle any scenario
with the exact same method name. Thus, depending on what the
object is asked to print, it will be able to print it.
Instead of having separate methods
like printPicture(), printLetters(), and printNumbers() you
have one unified print() and the object itself determines how
to handle the different types of situations.