View RSS Feed

Core Java

Outer and Inner classes

Rate this Entry
by , 01-08-2012 at 11:47 AM (1309 Views)
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 to implement helper classes like Comparators and Iterators.

Name:  59.JPG
Views: 98
Size:  17.2 KB

Outer and Inner classes

Submit "Outer and Inner classes" to Facebook Submit "Outer and Inner classes" to Digg Submit "Outer and Inner classes" to del.icio.us Submit "Outer and Inner classes" to StumbleUpon Submit "Outer and Inner classes" to Google

Categories
Classes

Comments