filmov
tv
Collection framework in Java- SortedMap and NavigableMap interface explained in detail

Показать описание
You can learn Java with me as the Java Programming language is being made easily. It would take a period of minimum three months and maximum 6 months to master Java. I would recommend you to watch all my videos to crack any software interviews that would require Java Programming language as a primary skill.
SortedMap:-
===========
1. SortedMap is a child interface to the Map interface.
2. It was introduced in JDK1.2 version.
3. It is going to store the data in the form of "Key":"Value" pair.
4. Please be informed that the keys are unique and the values can be duplicated.
5. By default, SortedMap does not follow insertion order with respect to keys.
6. By default, SortedMap follows sorting order with respect to keys
8. By default, SortedMap does not allow null key. And, if you add any null key, you will get
Please be informed that you are allowed to add the null value.
9. By default, SortedMap always allow comparable objects in the key.
Methods in SortedMap:-
======================
1. public Object firstKey();
2. public Object lastKey();
3. public SortedMap headMap(Object key);
4. public SortedMap tailMap(Object key);
5. public SortedMap submap(Object fromKey , Object tokey);
NavigableMap:-
============
1. NavigableMap is a child interface to the SortedMap.
2. It was introduced in JDK1.6 version.
3. It is very much similar to SortedMap. However, it has its own specific methods to deal with.
4. It is going to store the data in the form of "Key":"Value" pair.
5. Please be informed that the keys are unique and the values can be duplicated.
6. By default, NavigableMap does not follow insertion order with respect to keys.
7. By default, NavigableMap follows sorting order with respect to keys
9. By default, NavigableMap does not allow null key. And, if you add any null key, you will get
Please be informed that you are allowed to add the null value.
10. By default, NavigableMap always allow comparable objects in the key.
Methods inside NavigableMap:-
===========================
1. public NavigableMap descendingMap();
2. public Object ceilingKey(Object Key);
3. public Object higherKey(Object Key);
4. public Object floorKey(Object Key);
5. public Object lowerKey(Object Key);
6. public Object pollFirstEntry();
7. public Object pollLastEntry();
SortedMap:-
===========
1. SortedMap is a child interface to the Map interface.
2. It was introduced in JDK1.2 version.
3. It is going to store the data in the form of "Key":"Value" pair.
4. Please be informed that the keys are unique and the values can be duplicated.
5. By default, SortedMap does not follow insertion order with respect to keys.
6. By default, SortedMap follows sorting order with respect to keys
8. By default, SortedMap does not allow null key. And, if you add any null key, you will get
Please be informed that you are allowed to add the null value.
9. By default, SortedMap always allow comparable objects in the key.
Methods in SortedMap:-
======================
1. public Object firstKey();
2. public Object lastKey();
3. public SortedMap headMap(Object key);
4. public SortedMap tailMap(Object key);
5. public SortedMap submap(Object fromKey , Object tokey);
NavigableMap:-
============
1. NavigableMap is a child interface to the SortedMap.
2. It was introduced in JDK1.6 version.
3. It is very much similar to SortedMap. However, it has its own specific methods to deal with.
4. It is going to store the data in the form of "Key":"Value" pair.
5. Please be informed that the keys are unique and the values can be duplicated.
6. By default, NavigableMap does not follow insertion order with respect to keys.
7. By default, NavigableMap follows sorting order with respect to keys
9. By default, NavigableMap does not allow null key. And, if you add any null key, you will get
Please be informed that you are allowed to add the null value.
10. By default, NavigableMap always allow comparable objects in the key.
Methods inside NavigableMap:-
===========================
1. public NavigableMap descendingMap();
2. public Object ceilingKey(Object Key);
3. public Object higherKey(Object Key);
4. public Object floorKey(Object Key);
5. public Object lowerKey(Object Key);
6. public Object pollFirstEntry();
7. public Object pollLastEntry();