java - Why do you need to have the exact method as the base class when you extend a subclass? -
it has inheritance, still have no idea how connect 2 things together. example, why can't public void paint(graphics pane) public void draw(graphics pane) or public void paint(graphics pane, int x, int y)?
classes extend frame don't have override method. can override method want expand default behavior of frame (such painting custom background), including of paint() method mentioned above.
the other methods mentioned aren't defined in frame class, java doesn't know call them.
but said, there no rule saying have override of above methods. if aren't overriding methods, why extending frame in first place?
on other hand, should using jframe , not frame.
Comments
Post a Comment