Create Java Interface in BlueJ IDE
Create Java Interface in BlueJ IDE
A Java interface establishes a contract for what a class can do without specifying how it does it. It is a reference type that defines a set of abstract methods that implementing classes must provide implementation details.
Create a New Interface
To create an interface, follow the menu option:
Edit >> Create Class… and then choose the Interface button.
Enter the interface name and click on the OK button.
Enter the abstract methods and constant variables, mostly public, static, and final variables.
Example
In this example, we have created an interface with one method.
In Java, you don’t need to specify abstract for methods in an interface explicitly. By default, all methods in an interface are implicitly abstract unless they are default or static methods.
For more information on BlueJ IDE, visit the official website: