The Convert Abstract Class to Interface refactoring allows you to convert an abstract class
to an interface. This is especially useful when you want a class to inherit
from more than one abstract class, thus you need to convert one of them to an interface. The reverse
functionality is available
- Right-click the name of an abstract class in Class View, Object Browser, or the code editor, and select Refactor | Convert Abstract Class to Interface from the pop-up menu.
- Select ReSharper | Refactor | Convert | Abstract Class to Interface in the main menu.
If no conflicts are identified, the abstract class is converted into an interface of the same name. At the same time, modifiers of methods are changed accordingly.
Consider the following example:
FormatterClass to an interface, the code looks as follows:
You can change the name of the newly formed interface using the