CLASS-ID paragraph for defining a subclass
About this task
Use
the CLASS-ID
paragraph to name the subclass and indicate
from which immediate Java™ or
COBOL superclass it inherits its characteristics.
Identification Division. Required
Class-id. CheckingAccount inherits Account. Required
In the example above, CheckingAccount is the subclass being defined. CheckingAccount inherits all the methods of the class known within the subclass definition as Account. CheckingAccount methods can access Account instance data only if the Account class provides attribute (get or set) methods for doing so.
You must specify
the name of the immediate superclass in the REPOSITORY
paragraph
in the CONFIGURATION SECTION
of the ENVIRONMENT
DIVISION
. You can optionally associate the superclass name
with the name of the class as it is known externally. You can also
specify the name of the subclass that you are defining (here, CheckingAccount)
in the REPOSITORY
paragraph and associate it with
its corresponding external class-name.