1.

What do you mean by nested classes?

Answer»

Nested classes mean that we can define a class inside another class in an Object-oriented programming language (OOP). The enclosed class is called a nested class. A nested class has the same ACCESS rights as other MEMBERS of the class and is like another member of the OUTER class.

For example:

class Outer_class{  //code  class Inner_class{   //code  }  } 

In the above example, the Inner class is nested within the Outer class. The inner class will have the same access rights as the outer class. Nested classes help to group classes in one group.



Discussion

No Comment Found