Java have superclass code act on object
My question is about basic java inheritance and code structure, but I am
actually very confused about how invoking void superclass methods on an
object has a effect on that object.
For example, in my code I declare a CritterTest object as outlined in the
superclass Critter. I understand how to call functions on this object that
return a value, because then I can work in the subclass with that returned
value. However, when the method I attempt to call on the CritterTest
object does not have a return value (a void method) I am not sure how to
make the code in the super class act on the CritterTest object.
For an idea of how my code is structured, I have the class I am working
in, called TestingHarness, where I declare an object of the CritterTest
class.
Sorry if this question is too vague.
No comments:
Post a Comment