What is the difference between a static and a non-static inner class

A non-static inner class may have object instances that are associated with instances ofthe class's outerclass. A static inner class does not have any object instances.

Showing Answers 1 - 3 of 3 Answers

A static inner class need to be referred by the class name being it is static. A static inner class can have access even to the private members of the outer class.

The non-static inner class has the reference that is not visible in the outer class. To utilize the non-static inner class attributes and methods, its instance is to be created 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