Java how to optional override method in abstract class?

前端 未结 5 1102
小鲜肉
小鲜肉 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:38

    make your public BaseFragment class abstract

     public abstract class Fragment_Music extends BaseFragment{
                  @Override
    protected boolean postExec() {
        return false;
    } 
    
        }
    

提交回复
热议问题