Is there any easy way to generate Interfaces for Existing classes?

I have many classes.

Now i want all those classes to implement their own Interface. I can manually create interfaces by copying all method signatures to Interface.

Is there a automatic way to create them in Eclipse?

Upvotes: 0

Views: 58

Answers (2)

Vitkinov
Vitkinov

Reputation: 79

Try with right click on ImplementationClass in the package explorer or members view. Then go to Refactor(shortcut Alt + Shift + T) -> Extract Interface . Then select methods for Interface

Upvotes: 2

Erwin Bolwidt
Erwin Bolwidt

Reputation: 31269

In your source code or in package explorer or outline view, select one or more methods that are not yet implementing an interface, right-click and select "Refactor" --> "Extract interface"

Upvotes: 2

Related Questions