Declares an interface.
Interface Identifier [ Extends Interfaces ]
Declarations...
End [ Interface ]
The Interface keyword begins the declaration of an interface.
Please see the Interfaces section of the monkey language reference for more information on interfaces.
End | Class | Implements
Language reference (Interfaces)
An example of a simple interface.
Interface Computer Method Boot () Method Process () Method Display () EndClass PC Implements Computer Method Boot () Print "BIOS version 1.01. Performing ancient rituals..." End Method Process () Print "Calculating 1 + 1..." End Method Display () Print "The result of 1 + 1 equals 2!" End EndClass C64 Implements Computer Method Boot () Print "**** COMMODORE 64 BASIC V2 **** | 64K RAM SYSTEM 38911 BASIC BYTES FREE" End Method Process () Print "Calculating missile position..." End Method Display () Print "Enemies exploding!" End EndFunction Main () Print "" Print "PC" Print "" Local ibm:Computer = New PC ibm.Boot ibm.Process ibm.Display Print "" Print "C64" Print "" Local commodore:Computer = New C64 commodore.Boot commodore.Process commodore.DisplayEnd