0

Do subclasses of a class which implements Cloneable need also implement it explicitly?

I read some discussions about this (Do subclasses inherit interfaces?) but the answers are not very clear.

webpersistence
  • 844
  • 3
  • 12
  • 27

1 Answers1

1

No. Subclasses will inherit interfaces that their superclasses implement, and thus implicitly also implement the interface. However, it is arguably a better practice to explicitly enumerate the interfaces any given class implements.

See also What does it mean to “program to an interface”?

Elliott Frisch
  • 191,680
  • 20
  • 149
  • 239