8.15.0.5
4 Classes and Interfaces
Classes and Patterns shows the basic syntax of class for creating a new datatype. The class form also supports a body block (using :) immediately after the parenthesized field sequence. The body block supplies clauses that further customize a class, including making it a subclass of an existing class, adding methods to the class, and customizing its constructor. The interface form is similar to class, but an interface has only methods and can be implemented by classes.