Java - Implements clause

> Procedural Languages > Java

1 - About

To declare a class that implements an interface, you include an implements clause in the class declaration.

A class can implement more than one interface.

Advertising

3 - Syntax

To implement the interface, you'd use the implements keyword in the class declaration followed by a list of interface separated by a comma-separated.

class MyClass implements MyInterface1 [,MyInterface2,...]  {
 
   // remainder of this class implemented as before
 
}
lang/java/implement.txt · Last modified: 2017/02/12 21:05 by gerardnico