Saturday, August 28, 2010

Maps: Cartesian.java

Based on Sun Web Learning Center













Output is 

6 5
Keys of myMap: [ak, ar, bl, ca, co, fl]
Values of myMap: [50, 80, 110, 70, 60, 90]
Keys of myMap2: [ak, ar, bl, ca, co]
Values of myMap2: [50, 80, 110, 70, 60]


Please note, even though you added value to myMap2, myMap also get the same value added because myMap2 is defined to be a subset of myMap

No comments:

Post a Comment