Declares that class definition inherits a parent class.
Class Identifier [ < Parameters > ] [ Extends
Class ] [ Implements Interfaces ] [ Final ]
' Declarations...
End [ Class ]
The Extends keyword allows a class to 'extend' a parent class, thereby inheriting all of its fields, methods, functions, globals and constants.
This new class can add its own fields, methods, etc, but can also over-ride the existing fields, methods and so on by redefining them.
Class | Super
Language reference
Here we have three classes:
Class
Animal
Field
x
Field
legs
=
4
Method
Move
()
x
=
x
+
1
End
End
Class
Dog
Extends
Animal
Method
Bark
()
Print
"Woof"
End
End
Class
Fly
Extends
Animal
Field
legs
=
6
Field
y
Method
Move
()
x
=
Rnd
(-
4
,
4
)
y
=
Rnd
(-
4
,
4
)
End
Method
Buzz
()
Print
"ZzzzZZZzzzzzZZZZ..."
End
End