Java how to optional override method in abstract class?

前端 未结 5 1101
小鲜肉
小鲜肉 2021-02-07 01:50

Let\'s say we have a base class:

public abstract class BaseFragment extends Fragment {
    ...
    protected abstract boolean postExec();
    ...
}
5条回答
  •  鱼传尺愫
    2021-02-07 02:41

    You could derive a new abstract class with the new abstract method from your base class. Derive concrete classes that should have the new method from this new class and others from the old base class.

提交回复
热议问题