Navigation  without Java Scripts

Class Member Access Control

Access rights to class members in Visual Prolog are provided either by default (depending on the declaration placement) or by the access specifier PROTECTED.

A class member can be:
public
private
protected

 

Public class members can be used outside the class in which they are declared. By default all domains, predicates, and facts declared in class declarations are public.

Private class members can be used only inside the implementation of the class in which they are declared. All domains, predicates, and facts declared in the class implementations are private.

Protected class members can be used only inside the class in which they are declared and in classes directly inherited from this class.

The protected access mode is set by the PROTECTED keyword preceding declarations of domains, facts or predicates sections in class declarations.

PROTECTED {DOMAINS | PREDICATES | FACTS}
See also