Oct 29 Lecture Notes
- Arrays of objects
- JimsPoint.java
- TestPointArray.java
- Add in print statements which will show each variable,
and each slot in the array.
- Explain the "static" stuff - and add calls to test them.
- Fill in the other slots, but have some of them refer to
the same object.
- Zork
- Notice the "static" vs "instance" methods and variables.
- Notice the use of arrays of objects.
- How many rooms are there?
- How is the map information stored?
- Note the use of an explicit array {"North","South",...} to
initialize directions[].
- Why is Room[] public? (What happens if we make it private?)
- How would we add data and methods to pick things up
and carry them around from room to room?
- Why are the methods in class Game{} marked "static"?
- Note the boolean "or" in the Game.playing() if statements.
- What happens if the user mistypes? How would we fix that
to make it friendlier?
Jim Mahoney
Last modified: Tue Oct 29 00:01:08 EST 2002