Dhrubo
Posts: 32
Nickname: dhrubo
Registered: Mar, 2003
|
|
Re: TreeMaps
|
Posted: Apr 2, 2003 8:30 PM
|
|
Hope this helps
import java.util.*; class Union {
public static void main(String args[]) {
TreeMap a = new TreeMap();
a.put("1","One"); a.put("2","Two"); a.put("3","Three");
System.out.println("\nBefore Union : a ===> " + a);
TreeMap b = new TreeMap();
b.put("3","Three"); b.put("4","Four");
System.out.println("\nBefore Union : b ===> " + b);
a.putAll(b);
System.out.println("\nAfter Union : a ===> " + a);
}
}
|
|