Hariharan Selvarajan: TreeMap in Java 6 and java 7
Tuesday, February 26, 2013 TreeMap Class in Java In this post I am going to explain about some interesting difference between TreeMap class in Java 6 and Java 7 Collections. Before we are moving to TreeMap class we should know about the Map interface in Java Collection. Map : If we want to represent a group of objects as key-value pairs then we should go for Map in. Both keys and values are objects in Map. Duplicate keys are not allowed but values can be duplicated. There is no relationship between Collection (for group of individual objects) and Map (for group of key-value pairs). Each key-value pair is called as Entry. 6. There are two main Classes which is used often in our java program i) HashMap ii) TreeMap TreeMap: A class which implements the Sorted Map Interface. TreeMap implements the RED-BLACK Tree data structure concepts Insertion order is not preserved, because the all the entries are inserted based on some sorting order of keys.Read full article from Hariharan Selvarajan: TreeMap in Java 6 and java 7
No comments:
Post a Comment