/ Published in: Delphi
The difference between private, protected and public is pretty straightforward:
*Private members/methods are only visible within the class that declares them.
*Protected members/methods are visible within the class, and to all subclasses.
*Public members and methods are visible to all other classes.
In Delphi there's a "bug" that makes the visibility of all members public within the same unit. The strict keyword corrects this behaviour, so that private is actually private, even within a single unit. For good encapsulation I would recommend always using the strict keyword.
*Private members/methods are only visible within the class that declares them.
*Protected members/methods are visible within the class, and to all subclasses.
*Public members and methods are visible to all other classes.
In Delphi there's a "bug" that makes the visibility of all members public within the same unit. The strict keyword corrects this behaviour, so that private is actually private, even within a single unit. For good encapsulation I would recommend always using the strict keyword.