Previous: OOP Scopes To the Table of Content Next: Virtual Methods

- 2.2.13.6 -
TMT Pascal Language Description
Pascal Language Structure
OOP Extensions

Public and Private declarations

Public and private are standard directives in the Object Pascal language. Treat them as if they were reserved words. For readability, it is best to organize an object declaration by visibility, placing all the private members together, followed by all the protected members, and so on. This way each visibility reserved word appears at most once and marks the beginning of a new section of the declaration. So a typical object declaration should look like this:
type
  TObject = object
    private
      { Private declarations}
    public
      { Public declarations }
    end;
The scope of component identifiers declared in private component sections are restricted to the module that contains the object type declaration. Keep in mind that: Use the public part to Declarations in the private part are restricted in their access. If you declare fields or methods to be private, they are unknown and inaccessible outside the unit the object is defined in.

Use the private part to


Previous: OOP Scopes To the Table of Content Next: Virtual Methods
OOP Scopes Table of Content Virtual Methods

- 2.2.13.6 -