|
|
||||||||
|
||||||||
|
||||||||
|
|
|
| TreeMap in Java is the best solution for Java programs which are looking for sorted datastrucutre. TreeMap in Java sort keys based on either their natural order or any custom order defined by provided comparator while creating TreeMap. If you try to store any element in TreeMap which is not of same type like earlier key you will get ClassCastException because with every new key insertion treeMap sort all the keys. |
![]() |
| |
|
• Discuss Tutorial
• Comment On Tutorial |
• View Tutorial
• Report Broken Link |
|
|