How to force subclass to implement some methods in java?
I have the Screen interface in libgdx framework.
I create a subclass called BaseLayout, where I initialize some fields.
Now for every actual screen e.g. MenuScreen I extend this BaseLayout class.
I want to force these classes e.g. MenuScreen to implement two methods
void initData(), and void addButtonsToScreen(). How to do this?
I call these methods in the show method only implemented in the base class
BaseLayout.
No comments:
Post a Comment