What is the difference between inner classes and nested classes? Where is each used in?

Showing Answers 1 - 1 of 1 Answers

A.Durga Ganesh Reddy

  • Nov 27th, 2007
 

To define a class with in another class, such classes are called Nested classes.The most import nested class is inner class. i.e. An inner class is a non-static nested class.difference:>A Nested class has access to the members, including private members of the class in which it is nested.however the enclosing class does not have access to the members of nested class.> A inner class has access to all of variables and methods of the outer class do.this class is fully with in the scope of its enclosing class.members of inner class may not used in the outer class.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions