The keywords public, private and protected define the visibility of members (properties and methods) of a class.
Members of a class defined as public are visible, i.e. directly accessible, by all scripts of an application, including all functions and all base and derived classes.
Members defined as private are visible only from within the class they belong to.
Members defined as protected are visible only from within the class they belong to and from within classes derived from the latter.
All functions are considered to be "public".