Public and private

public - public methods and variables can be accessed by any method and any class.

private - private methods and variables cannot be accessed through anything except the class. that is why we use accessors (setters and getters). those functions are in the class and thus thy can access the private variables.

it's important to note that subclasses cannot access private variables of the super class. we can either leave them as public, use accessors, or protected (see 6.1)