Answer: In some cases, we may have a
class (or struct) inside another
class.
That inner
class (or type such as
struct) is known as a
Nested class or
Nested type.
Example,
class Outer
{
class Inner // Nested class
{
.........;
........;
}
}
Any class declared outside (such as in a namespace or any compilation unit), is known as
Non-Nested class or
Non-Nested type.
Asked In: Spotted While Learning |
Alert Moderator