Thursday, August 20, 2009

Types of Inner Class in Java

Hi friends, Java Code Online welcomes you back again. Today's article discuss the Inner classes in Java. An Inner class is like a class but it is defined inside another class. So the behavior is like of a class but is internal to a class.

The Inner Classes can be classified in four types. They are:-
1. Regular Inner Class
2. Method Local Inner Class
3. Anonymous Inner Class
4. Static Nested Inner Class

All the types of inner classes are defined in their respective articles. The Inner classes though not much commonly used in Java, still find some important place in some programs. Though it is a bit too odd to see a class being placed inside another class, the behavior is more or less like a local method of the outer class. There is different functionality for all the different types of Inner classes. You may find the details in the individual articles for each type of Inner class.

I hope the article was able to clear your myth and doubts about the Inner classes in Java. If you liked the article then do leave a comment. Keep buzzing Java Code Online for more Java articles.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.