Created
March 13, 2013 03:07
-
-
Save ayato-p/5149087 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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()); | |
} | |
} | |
} |
This file contains hidden or 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
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