8.16.0.2
4.1 Subclasses
When defining body of a new class, add extends clause followed by the name of an existing class. Instances of the new class, the subclass, will also count as instances of the existing class, the superclass. Since that creates obligations on the superclass, however, a class is final by default, which means that it does not permit subclasses.
class Posn(x, y)
To allow subclasses, add a nonfinal clause in a class:
When a subclass is created, superclass fields are implicitly included before new fields in the subclass’s constructor:
> p
Posn3D(1, 2, 3)
> p.y
2
> p is_a Posn
#true
> p is_a Posn3D
#true