Thursday, June 25, 2009

How to Create a Map


Map is a list of key-value pairs

// Create a hash map
Map map = new HashMap();

// Add key/value pairs to the map
map.put("a", new Integer(1));
map.put("b", new Integer(2));
map.put("c", new Integer(3));

0 comments:

 

Sample Java Codes Copyright © 2008 Green Scrapbook Diary Designed by SimplyWP | Made free by Scrapbooking Software | Bloggerized by Ipiet Notez