Java Interfaces
In Java programming, an interface is a collection of method declaration and constant that one or more class can use. It is syntactically similar to the class but the main difference between class and interface is that class contain method declaration with method body and interface method declares without any body. Syntax of interface:
1 2 3 4 5 6 7 8 9 10 11 | access specifier interface InterfaceName { type var1 = value; type var2 = value; ..... .... type method1(parameter list); type method2(parameter list); } |