java - Why implement the inherited abstract method? -
i have confusion in "beginning android game" book, chapter 3, pg.100-101. think i've follow book instruction, ide still give me error:
the type myawesomegame must implement inherited abstract method game.getfileio()
how can fix it, or implement don't grasp yet?
and here codes:
public class myawesomegame extends androidgame { public screen getstartscreen(){ return new mysuperawesomestartscreen(this); } } public abstract class androidgame implements game { } public interface game { public input getinput(); public fileio getfileio(); public graphics getgraphics(); public audio getaudio(); public void setscreen(screen screen); public screen getcurrentscreen(); public screen getstartscreen(); }
a concrete class must implement abstract methods of ancestor abstract classes.
in case abstract parent class - androidgame - implements interface - game, each concrete sub-class of abstract class (such myawesomegame class) must implement methods of interface.
Comments
Post a Comment