      $set repository(update on checking on)
123456 class-id. Car inherits Vehicle Motor.
 
       repository.
           class Car 
           class Vehicle
           class Motor
           class CharString as "String"
           interface Displayable as "Displayable"
           .

       factory.

      *------------------------------------------------------------------      
      * 
      * newCar: create a new vehicle with 4 wheels and 1 engine
      *         and default engine size of 6!
      *
      *------------------------------------------------------------------      

       method-id. "newCar".
       linkage section.
       1 lk-name    pic x any length.
       1 lk-doors   binary-char unsigned.
       1 lk-windows binary-char unsigned.
       1 lk-obj-ref usage object reference active-class.
       procedure division using lk-name lk-doors lk-windows
                          returning lk-obj-ref.

           invoke super "newvehicle" using "Car" 4 
                                     returning lk-obj-ref

           invoke lk-obj-ref "initcar" using lk-name lk-windows lk-doors

           exit method
           .
       end method "newCar".
       
       end factory.

      *------------------------------------------------------------------

       object. implements Displayable.
       working-storage section.
       1 carDoors   binary-char unsigned     property no set.
       1 carWindows binary-char unsigned     property no set.
       1 carName    object reference CharString property no set.

      *------------------------------------------------------------------
       
       method-id. "initCar".
       linkage section.
       1 lk-doors   binary-char unsigned.
       1 lk-windows binary-char unsigned.
       1 lk-name    pic x any length.
       procedure division using lk-name lk-windows lk-doors.
           set  carName    to CharString::"newstring"(lk-name)
           move lk-windows to carWindows
           move lk-doors   to carDoors

            invoke self  "initmotor" using 1 6

           exit method
       end method "initCar".

       method-id. "display" override.
       procedure division.
           invoke carName "display"
           display ": " with no advancing
           invoke super "display"
           display " has " carWindows " windows and " carDoors " doors."
           invoke self "displaymotor"
           exit method
       end method "display".

       end object.

       end class Car.
