Defining a Subclass of the New Class

Using the SUBCLASS method, you can define a subclass for your new class and then a method for that subclass. To define a Savings subclass for the Account class, and a TYPE method for Savings, enter:

savings = account~subclass('Savings Account')
savings~define('TYPE', 'return "a savings account"')


[Back: Adding a Method to a Class]
[Next: Defining an Instance]