Previous Topic Next topic Print topic


Constructors and Deconstructors - in COBOL and

Constructors and Deconstructors in Managed COBOL

class-id SuperHero.
working-storage section.
01 powerLevel binary-long.
method-id new.
procedure division.
    set powerLevel to 0
end method.
 
method-id new.
procedure division using by value powerLevel as binary-long.
    set powerLevel to powerLevel
end method.
method-id Finalize override protected.
    *> Destructor code to free unmanaged resources.
end method.

end class SuperHero.
Previous Topic Next topic Print topic