Sunday, 6 March 2011

grid world page 33-34

1
Why does act() cause aChameleonCritter to act differently from a Critter even though ChameleonCritter does not override act()?
Act method calls other methods differently  
2
Why does the makeMove() method of ChameleonCritter call super.makeMove?
Rest of the code for method is the same as in super class, the method calls on the super class methods instead of duplicating the code. 
3
How would you make theChameleonCritter drop flowers in its old location when it moves?
makeMove() has to be altered to drop flowers from the bug. 
4
Why doesn’t ChameleonCritter override the getActors() method?  
Using same methods from the superclass.  
5
Which class contains the getLocation()method?
Actor
6
How can a Critter access its own grid?  
getGrid()  method.


1
Why does act() cause aChameleonCritter to act differently from a Critter even though ChameleonCritter does not override act()?
Act method calls other methods differently  
2
Why does the makeMove() method of ChameleonCritter call super.makeMove?
Rest of the code for method is the same as in super class, the method calls on the super class methods instead of duplicating the code. 
3
How would you make theChameleonCritter drop flowers in its old location when it moves?
makeMove() has to be altered to drop flowers from the bug. 
4
Why doesn’t ChameleonCritter override the getActors() method?  
Using same methods from the superclass.  
5
Which class contains the getLocation()method?
Actor
6
How can a Critter access its own grid?  
getGrid()  method.

No comments:

Post a Comment