Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Language Reference


Inheritance

Every method available on instances of a class is also available on instances of any subclass directly or indirectly derived from that class. A subclass can introduce new methods that do not exist in the parent or ancestor class and can override a method from the parent or ancestor class. When a subclass overrides an existing method, it defines a new implementation for that method, which replaces the inherited implementation.

The instance data of class-name-1 is the instance data declared in class-name-2 together with the data declared in the working-storage section of class-name-1. Note, however, that instance data is always private to the class that introduces it.

The semantics of inheritance are as defined by Java. All classes must be derived directly or directly from the java.lang.Object class.

Java supports single inheritance; that is, no class can inherit directly from more than one parent. Only one class-name can be specified in the INHERITS phrase of a class definition.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)