![]() |
VOOZH | about |
The checkedNavigableMap() method of Java Collections is a method that returns a dynamically and typesafe view of the given Map. Any attempt to insert an element of the wrong type will result in an immediate ClassCastException.
Syntax:
public static <Key,Value> NavigableMap<Key,Value> checkedNavigableMap(NavigableMap<Key,Value> Map, Class<Key> keyType, Class<V> valueType)
Parameters:
Return: This method will return the dynamically and typesafe view of the given Map.
Exceptions:
Example:
{id1=56, id2=15, id3=19, id4=70}
Example 2:
{id1=sravan, id2=manoj, id3=sai, id4=vignesh}