Inner class has a link with enclosing class instance just the way with instance methods & variables. It also has a direct access to fields and methods of the object. Because of the association of the inner class with an instance, static member cant be defined by it. Inner classes instances i.e. object are present in outer class instance. Let us consider these classes: Java Code: class OuterClass { ... class InnerClass { ... } ...
class OuterClass { ... class InnerClass { ... }
All the classes in Java are not defined separately from other classes. You can also write one class into another class. The inside class is referred as inner class and the class containing this inner class is called outer class. Inner class is a member of outer class similar to other attributes and methods. Avoid using inner classes when they are not required. It is hard to maintain and reuse code with inner classes. Only use it when it is required and relevant. They are used usually ...
PDF to TIFF Conversion & Control...
05-24-2013, 11:39 AM in Java Software