Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to use Generic HashMap

Java: How to use Generic HashMap

import java.util.HashMap;
public class Generic_Hash
  public static void main(String[] args) 
    HashMap map = new HashMap();
    map.put(1, "January");
    map.put(2, "February");
    map.put(3, "March");
    map.put(4, "April");
    map.put(5, "May");
     System.out.println (map.get(2)); // February

Users who found this page were searching for:

  • using sql with perl
  • java hasmap generic class
  • HashMap

No comments yet.

Leave a Comment