| | | Some Mysteries of objectdraw, Explained |
Some Mysteries of objectdraw, Explained
Today, we are going to resolve some mysteries about Java and the
code that you have been writing this semester. Here are some
questions that should bother you:
- When writing methods in a WindowController, why can
you refer to "canvas" without declaring it, but you
have to pass the canvas explicitly as a parameter to other
classes?
- Usually when we call methods that we have not defined in our
class, we say someObject.someMethod().
There are some exceptions to this rule: getImage,
getTime, etc. Why don't we need to include an object?
- When we write a method call, normally the next code to
execute is within that method. However, when we are writing an
ActiveObject, we call start and the method named
run is executed. Why don't these names match?
- We saw a bit about implements, what about
extends?
| | | Some Mysteries of objectdraw, Explained |