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.
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