8.12

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.

    4.1 Subclasses

    4.2 Interfaces

    4.3 Methods

    4.4 Fields and Properties

    4.5 Constructors

    4.6 Binding and Annotation

    4.7 Private Fields and Methods

    4.8 Private Implementation

    4.9 Class Namespaces

    4.10 Mutual Dependencies