Java: Force subclasses to override methods of the Superclass

Dj Boris picture Dj Boris · Sep 11, 2011 · Viewed 13k times · Source

How can I write a method and force the subclasses to override this method. In Eclipse it should show in the Quick-Fix Dialog: "Add unimplemented methods".

Thanks

Answer

aioobe picture aioobe · Sep 11, 2011

How can I write a method and force the subclasses to override this method.

Declare the method as abstract:

enter image description here

Eclipse will give you the "Add unimplemented methods"-option for all (unimplemented) abstract methods and interface methods.