Mandatory cloneable interface in Java

后端 未结 6 1599
北恋
北恋 2021-01-06 09:01

I\'m having a small problem in Java. I have an interface called Modifiable. Objects implementing this interface are Modifiable.

I also have a ModifyCommand class (wi

6条回答
  •  生来不讨喜
    2021-01-06 10:02

    What does your method signature for your clone method look like? For it to match the Clonable interface it would have to return an Object. If you're declaring it as returning a Modifiable then that could be the problem.

提交回复
热议问题