Skip to content

Instantly share code, notes, and snippets.

@twopoint718
Created June 11, 2009 21:33
Show Gist options
  • Save twopoint718/128250 to your computer and use it in GitHub Desktop.
Save twopoint718/128250 to your computer and use it in GitHub Desktop.
HashMap w/ String and integer key
import java.util.*;
public class FooMap
{
public static void main(String[] args)
{
HashMap<String,String> data =
new HashMap<String,String>();
String k1 = "A" + 1;
data.put(k1, "This is at A1");
String k2 = "B" + 2;
data.put(k2, "This is at B2");
System.out.format("Data at B2: [%s]\n", data.get("B"+2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment