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
Public: is a default state when you declare a variable or method, can be accessed by anything directly to the object.
Public
Protected: Can be accessed only within the object and subclasses.
Protected
Private: Can be referenced only within the object, not subclasses.
Private