Member Inner Classes

Sub type of Inner Classes!!!

It is defined at the same level as the member functions, constructors and fields.

Instantiating object of the Member Inner Class :
-Create an object of the outer class.
-Using object of the outer class create object of the inner class.
-If you want to use the inner class within the class ( say inside a method ),
just create an object of the inner class there. Thats it!

When we compile the java class ( OuterClass ) which has a inner class ( InnerClass ) , two class files are created :
1. OuterClass.class
2. OuterClass$InnerClass.class

Comments

Popular posts from this blog

Writing your own ejabberd Module

npm ECONNREFUSED error

Conditional Flow - Spring Batch Part 6