-
Overriding Methods
Okay, I have a superclass called "Piece" and the subclass, "Wall", which extends it. In the superclass I have a method called act(), but when it is a Wall I want it to override that method and use Wall's act(). Normally this would work, as far as I know, but for some reason it isn't. Does it matter that my array Piece[][] field contains Wall objects? So, if I say field[i][j].act() on a Wall object in that array (of type Piece), should it use Wall's act() or Piece's act()?
-
It worked for me? Your methods haven't been declared static, have thy!
-
EDIT: I think I know the problem.