These are Interfaces defined for Java. They act like public facing APIs. They are similar to Java Abstract Class, but they:
- Cannot have any Concrete Methods
- The only attributes allowed must be
final static
attributes (attributes are not well supported)
Implementing a Interface
class myClass implements myInterface{
// ...
}
Boilerplate
interface Animal {
public static int mytag;
public void animalSound(); // interface method (does not have a body)
public void run(); // interface method (does not have a body)
}