Classes

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 -

  1. Static Nested Classes
  2. Member Inner Class - Class per instance/object of Outer class.
  3. Method-Local Inner Classes - Class within a method.
  4. 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