•If a class is defined within another class in the public section, the nested class is available for use the
same as objects defined
for the outer class.
•To
define objects of a public nested class, the name of the nested class must be qualified by the outer
class' name (i.e.,
outer_class::nested_class).
nclass outer_class
{
n public:
n class nested_class {
n public:
n nested_class(); //nested class'
constructor
n ...
n };
•outer_class::nested_class object; //define an object