Copy map content to another treemap
We can use putAll() method to copy map content to another treemap. putAll(Map m): Puts all the entries from m into this map. Syntax: public void putAll(Map m) Example package com.w3schools; import java.util.TreeMap; public class Test { public static void main(String args[]){ //Create TreeMap object. TreeMap<Integer, String> treeMap = new TreeMap<Integer, String>(); … Read more