Skip to content

Instantly share code, notes, and snippets.

@ayato-p
Created March 13, 2013 03:07
Show Gist options
  • Save ayato-p/5149087 to your computer and use it in GitHub Desktop.
Save ayato-p/5149087 to your computer and use it in GitHub Desktop.
public class Logger {
public static void log(HashMap<String, Object> map) {
for (Map.Entry<String, Object> e : map.entrySet()) {
System.out.println(e.getKey() + ":" + e.getValue());
}
}
}
public class Main {
public static void main(String[] args) {
Logger.log(new HashMap<String, Object>(){{
put("int1", 1);
put("str", "Hello");
}});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment