An alternative way to create a new interface is to add it to an existing compilation unit. To do this,
1. In the Package Explorer, double-click a compilation unit.
2. Type the code for the interface at the desired position in the compilation unit.
Creating Java elements
Creating a new Java interface
Creating a nested interface
Creating a top-level interface
Renaming a compilation unit