I have something like this:
class SuperClass {
public void onClick(){
if(disabled) return;
}
}
class SubClass extends SuperClass {
public void onClick(){
super.onClick();
System.out.println("Clicked");
}
}
This outputs "Clicked" every time I click the button.
I want the SubClass onClick() to not work if disabled is true and don't want to add an extra line in every SubClass. How can I do that?