Missing Method body, or declare abstract

后端 未结 2 1329
梦如初夏
梦如初夏 2021-01-28 04:55

I am getting this error message:

Exception in thread \"main\" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Pet.saySomething

2条回答
  •  孤街浪徒
    2021-01-28 05:44

    If Speak is a concrete class, it must implement all of its methods, so saySomething must have a body.

    However, it looks like Speak is more suitable to be an interface. Your Pet class can implement that interface.

提交回复
热议问题