In
java inner class which is defined inside another class is called nested class
or non-static inner class. For instantiating the inner class or nested class object we first need to
create the outer class object. We can access outer class member’s
variables insides of inner class just like normal members variables of class.
We cannot
declare static method or static variable inside the non-static inner class. If we
try to declare it shows error The field or static variable cannot be declared static in a non-static
inner type. read more
0 comments:
Post a Comment