Thursday, December 9, 2010

Candle Wax From Cashmere

How to use the HashMap in Java?

On this website there are two very significant examples of how to use the HashMap in Java. Here are the first :

import java.util.HashMap;

HashMapExample {public class

public static void main (String [] args) {HashMap

myMap = new HashMap ();

map.put ("1", "A");
map.put ("2", "B");
map.put ("3", "C");

String one = (String) map.get ("1");
System.out.println (one);
}}


While to this address you can find the second example.
addition many posts about HashMap.

0 comments:

Post a Comment