How to fix “Constructor Calls Overridable Method”

后端 未结 4 1833
无人及你
无人及你 2021-01-01 23:59

I have the following setup which is giving me a message stating that \"Constructor Calls Overridable Method\". I know this is happening, but my question is how to fix it so

4条回答
  •  情书的邮戳
    2021-01-02 00:50

    You could declare doFoo as final if you don't need to override that method later:

    public final void doFoo() { }

提交回复
热议问题