How to generate method stubs for all not implemented methods in interfaces / abstract classes using eclipse?

In eclipse, I have the following problem very often when writing java code: During coding (especially in the early coding time) I often have to change interfaces until everything works. If I change such a Superclass, I must change each subclass to implement the method.

It is clearly necessary that all the code work, but I would like to test things without having to encode every bit. Next trick with

  • Class opening
  • Clicking on the class name (errorous)
  • ressing <Alt>+ <1>and selectingImplement all un-initialized methods

It takes quite a while when I have to do this many times.

Is there a way to select all related classes and click in the IDE in some magic menu to generate all non-integrated methods in these classes as stubs?

+1
source share
1 answer

The problem is not the IDE, which does not provide support for such an action. But what does your coding look like that needs to be improved.

An alternative for you might be Java 8, where you can use the default methods for the interface.

Then you no longer have to update child classes.

0
source

All Articles