In Java, the interface keyword is used to declare an interface:

interface Vehicle {
    void start();
    void stop();
}

Interface is a programming construct that defines a contract which must be adhered by implementing classes. The methods defined in an interface must have no body and end with a semicolon. The implementing classes will provide concrete implementation for the methods.

Related keywords: class and implements. See all Java keywords.

 

Related Topics:

 

Other Recommended Tutorials:


About the Author:

is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.



Add comment