What is nested class ?
Classes can be define inside other classes. Classes that are inside other classes are called nested class.
A classes can be nested in every part of the surrounding classes in the public, protected and private section. Such a nested class can be considered a member of the surrounding class. The normal access and visibility rules in classes apply to the nested class.
In public section : It is visible outside in surrounding class.
In protected section : It is visible in sub – classes derived in the surrounding class.
In private section : It is only visible for the member of the surrounding class.
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment