Created
June 11, 2009 21:33
-
-
Save twopoint718/128250 to your computer and use it in GitHub Desktop.
HashMap w/ String and integer key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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