LoginSignup
6
1

More than 5 years have passed since last update.

[java]Mapクラスのオブジェクトの中身を全て確認するコード

Posted at

備忘録として記入

public static void main(String arg[]) {
    Map<String, String> map = new HashMap<>();
    map.put("key1", "val1");
    map.put("key2", "val2");

    for (String key : map.keySet()) {
        System.out.println(key + ":" + map.get(key));
    }
}

参考リンク

6
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1