Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

METHOD-ID paragraph

Function

The METHOD-ID paragraph indicates that this Identification Division introduces a method definition and specifies its name and its attributes.

Format


METHOD-ID. method-name-1 [OVERRIDE] [IS FINAL].


Syntax rules

  1. If the OVERRIDE phrase is specified, there must be a method with the same method-name-1 in one of the inherited classes. The method in the superclass may not be defined with the FINAL clause.

  2. If the OVERRIDE phrase is not specified, there should not be a method with the same method-name-1 in any of the inherited classes.

  3. The OVERRIDE clause may not be specified in an interface method.

  4. The FINAL clause may not be specified in an interface definition.

  5. If method-name-1 is the same as a method-name inherited by the classes, the interface of method-name-1 must be conform with the interface of the inherited method(s).

  6. The names of the methods in a class must be unique.

General rules

  1. method-name-1 is the name of the method specified by the method definition.

  2. The OVERRIDE phrase indicates that the method method-name-1 overrides any inherited method of the same name.

  3. The FINAL clause indicates that this method may not be overridden in any inherited class using OVERRIDE.

  4. method-name-1 can be used in the call to a method for an object of the class in which this method is defined.

  5. If a given user-defined word is defined in the Data Division of this method definition and in the Data Division of the containing factory definition or object definition, the use of that word in this method refers to the declaration in this method. The declaration in the containing factory object or object definition is inaccessible to this method.