Extracting an interface from a class is a useful technique when you have many objects that have similar behavior and you want to impose a contract on your objects stating that they must all implement the same set of methods.
If you have a class and wish to extract an interface from it, NetBeans Extract Interface refactoring allows this to be easily achieved.
First we will need a Java project so that we can extract an interface from a class. We will use the same project from the earlier recipe, Rename refactoring, and so ensure that you have the project open from the end of that recipe. If you have not followed that recipe, the project is available from the code download bundle under the
MoveRefactor folder ...