Object types (object: reserved word)


  Object types     (object: reserved word)

An object type is a data structure that contains a fixed number of components.




Objects consist of an identifier, a colon and a data type. In addition, object contain method headers.

Each component is either a field (which contains data of a particular type) or a method, which performs an operation on the object.

The declaration of a field specifies an identifier that names the field, and its data type. The declaration of a method specifies a procedure, function, constructor, or destructor heading.

   Field  = FieldName(s): type;
   Method = procedure MethodName(<parameter(s)>:type);
       or = function MethodName(<parameter(s)>:type):type;
       or = constructor MethodName(<parameter(s)>: type [;<parameter(s)>:
            type]); [virtual];
       or = destructor MethodName[(<parameters>: type)];[virtual];

An object type can inherit components from another object type. The inheriting object is a descendant and the object inherited from is an ancestor.

The domain of an object type consists of itself and all its descendants.

See Also

Тэги: object Types
| G+
Код для вставки: :: :: :: ::
Поделиться: // //