|
Answer» A nested class is a class, DEFINED within the scope of another class. Let's take an example:
Nested CLASSES are USED to organize the codes and control the access of DIFFERENT codes. In the preceding example, if the access specifier is made PUBLIC for the nested classes, then the name should be classA (outer class):: classD(nested class). If the access specifier is made private, then the nested class can be accessed by the members of the outer class only.
A nested class is a class, defined within the scope of another class. Let's take an example:
Nested classes are used to organize the codes and control the access of different codes. In the preceding example, if the access specifier is made public for the nested classes, then the name should be classA (outer class):: classD(nested class). If the access specifier is made private, then the nested class can be accessed by the members of the outer class only.
|