Search code examples
javamethodsoverridingsuperclass

Java: Force subclasses to override methods of the Superclass


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


Solution

  • 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.