An inner class is a nested class that is not explicitly or implicitly declared static. Inner classes may not declare static members, unless they are compile-time constant fields. Member interfaces are always implicitly static so they are never considered to be inner classes.
Types of Nested Classes -
Local - new Class is defined,
Anonymous - new Interface implementations is defined. new Runnable(),
Non-Static -
Static ( this is not really inner class just nested class )
http://www.programcreek.com/2009/02/4-inner-classes-tutorial-examples/
Types of Nested Classes -
- Static Nested Classes
- Member Inner Class - Class per instance/object of Outer class.
- Method-Local Inner Classes - Class within a method.
- Anonymous Inner Classes - New Interface Implementation. - new Runnable()
Local - new Class is defined,
Anonymous - new Interface implementations is defined. new Runnable(),
Non-Static -
Static ( this is not really inner class just nested class )
http://www.programcreek.com/2009/02/4-inner-classes-tutorial-examples/
No comments:
Post a Comment