Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 392 Bytes

File metadata and controls

19 lines (14 loc) · 392 Bytes

Interface Declaration

To declare an interface you write the word interface followed by the name of the interface and {}.

interface Dog {}

Inside of the {} you can write the signatures for methods followed by a ;. That means no method body and no public or private modifiers.

interface Dog {
    void bark();

    String fetch(String ball);
}