Example: defining a class

The following example shows a first attempt at the definition of the Account class, excluding method definitions.


 cbl dll,thread,pgmname(longmixed)
 IDENTIFICATION DIVISION.
 Class-id. Account inherits Base.
 ENVIRONMENT DIVISION.
 Configuration section.
 Repository.
     Class Base    is "java.lang.Object"
     Class Account is "Account".
*
 IDENTIFICATION DIVISION.
 Object.
  DATA DIVISION.
  WORKING-STORAGE SECTION.
  01 AccountNumber  pic 9(6).
  01 AccountBalance pic S9(9) value zero.
*
  PROCEDURE DIVISION.
*
*   (Instance method definitions here)
*
 End Object.
*
 End class Account.