When and why should I use public, private, and protected functions and variables inside a class? What is the difference between them?<
public
private
protected
private - can be accessed from WITHIN the class only
protected - can be accessed from WITHIN the class and INHERITING classes
public - can be accessed from code OUTSIDE the class as well
This applies to functions as well as variables.