maxime
maxime

Reputation: 2315

IntelliJ : Add a class method to one of the interfaces it implements

I have a "C" class that implements two interfaces (lets call them "IAlpha" and "IBeta").

I created a new method a method on my C class that I want to push up to the IAlpha interface.

Is there a way to do this ?

I tried to use Right click on method->Extract->Interface, but it seems to work only to create the whole Interface from a class and not for appending.

Upvotes: 2

Views: 564

Answers (1)

maxime
maxime

Reputation: 2315

As answered here by CrazyCoder (thanks), the solution is to :

Right click on the method -> Refactor -> Pull members Up...

Then you will be able to select the Interface on the dropdown menu. Intelli J Pull members up - add method to interface

Upvotes: 2

Related Questions