Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsUnmodifiableNavigableMapExample2 { public static void main(String[] args) { NavigableMap
map = new TreeMap<>(); map.put(1, "one"); map.put(2, "two"); System.out.println("Initial Unmodifiable Navigable Map: "+map); NavigableMap
map2 = Collections.unmodifiableNavigableMap(map); map2.put(3, "three"); } }
Output