Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save avdi/3184 to your computer and use it in GitHub Desktop.
Save avdi/3184 to your computer and use it in GitHub Desktop.
import java.util.*;
public class Scratch {
public static void main(String[] args) {
HashMap<String, Integer> stuff = new HashMap<String, Integer>() {{
put("A", 1);
put("B", 2);
put("C", 3);
}};
for(String key : stuff.keySet()) {
System.out.println(key + ": " + stuff.get(key));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment