Language syntax
Java Class implements interfaces
Declares interface types supported by a class. A concrete class must satisfy their abstract method contracts.
Formal Syntax & Structure
java syntaxjava
class Pass implements Printable, IdentifiedWorking Example
Example Snippetjava
interface Printable { String printText(); }interface Identified { int id(); }class Pass implements Printable, Identified { public int id() { return 7; } public String printText() { return "Pass " + id(); }}public class Main { public static void main(String[] args) { Pass pass = new Pass(); Printable printable = pass; Identified identified = pass; System.out.println(printable.printText()); System.out.println(identified.id()); }}