what is the public and private in C++?

Public variables, are variables that are visible to all classes.
Private variables, are variables that are visible only to the class to which they belong.
Protected variables, are variables that are visible only to the class to which they belong, and any sub classes.
The following table shows the access to members permitted by each modifier.
Access Levels Modifier Class Package Subclass World
public Y Y Y Y
protected Y Y Y N
no modifier Y Y N N
private Y N N N