We have HashMap.Entry class that is declared as a static inner class, I was searching for why it has been declared as static inner class and I found this post, which talks about when to use what type of inner classes.
In Short,
- Convenient way of grouping classes without using packages
- To create an instance of this class, we don't need outer class's object
- It will help you to extend from some other class
java.util.HashMap.Entry
- java.util.LinkedHashMap.Entry
- java.util.HashMap.EntrySet
- java.util.HashMap.HashIterator
- java.util.LinkedHashMap
No comments:
Post a Comment