import java.util.*; public class TestHashMap { public static void main(String[] args) { LinkedHashMap hashMap = new LinkedHashMap(); Object[] oArray = {10,"1","getThis()" }; hashMap.put( "One", oArray ); Object[] oArray2 = {10,"2","getThis()2" }; hashMap.put( "Two", oArray2); Object[] oArray3 = {10,"3","getThis()3" }; hashMap.put( "Three", oArray3 ); System.out.println("hashMap.size(): " + hashMap.size()); System.out.println("Viewing all keys and Values from the HashMap"); //Let's use the Iterator to look at each key/value pair Iterator iterator = hashMap.keySet().iterator(); while( iterator.hasNext() ){ String mapKey = iterator.next().toString(); Object[] tempArr = (Object[])hashMap.get(mapKey); System.out.println( "Key: " + mapKey + " ; " + "Value: " + tempArr[1]); } } }