Which of the following are true about nested class ?

  1. Nested class is a way of logically grouping classes that are only used in one place.

  2. A static nested class can refer directly to instance variables or methods defined in its enclosing class.

  3. Nested classes can lead to more readable and maintainable code.

  4. A static nested class interacts with the instance members of its outer class.


Correct Option: A,C,D

Find more quizzes: