ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

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 AltEnter and use the corresponding quick-fix to  rename the interface.

This feature is supported in the following languages and technologies:

The instructions and examples given here address the use of the feature in C#. For more information about other languages, refer to corresponding topics in the Languages and frameworks section.