Eclipse Creating a Java Interface
Opening the new Java interface wizard
The new Java interface wizard can create new Java interfaces. The ways to open the wizard are:
- Click the File menu and select New > Interface
- Right-click in the Package Explorer window and select New > Interface
- In the drop-down box button on the toolbar (
) select (
)
Before opening the create Java interface wizard, it is best to select the package name the Java interface belongs to, so that the package field will be filled in automatically when creating the Java interface.
Using the new Java interface wizard
In the Java interface wizard dialog, you can perform the following operations:
- Confirm that the folder name (Source Folder) and package name (Package) are correct
- Enter the interface name
- Click the Add button and select the interface to be inherited
- Select whether to automatically generate comments
- Click the Finish button
Viewing the new java interface
In the Package Explorer view, we can see the new interface, and we can modify the interface code through the Java editor on the right.