Convert Abstract Class to Interface refactoring

Last modified: 25 September 2024

This refactoring allows you to convert an abstract class to an interface. This can be useful when you want a class to inherit from more than one abstract classes — then you can easily convert one of them to an interface.

Consider the example below. After applying the refactoring, a class is converted into an interface:

By default, the naming style for interfaces requires interface names to start with I. Therefore, if you did not change the settings, the interface name will be highlighted as inconsistently named. Just press and use the corresponding quick-fix to  rename the interface.