In C++, this optional keyword starts declaring the public data members and/or member functions. The public members of a class are highly accessible by other program parts.

It is invoked thus:

class foo
public data members
public member functions


The public section tells the compiler that the data members and member functions are accessible to everything. ALL functions in the program can access public methods and data whether they are instances of the class, descendants, or neither.