0
0

More than 1 year has passed since last update.

Mapに値格納、取り出しサンプル

Posted at
sample.java
    public static void main(String[] args) {
        Map<String,Integer> mp = new LinkedHashMap();
        mp.put("a1",1);
        mp.put("a2",2);
        System.out.println(mp.getClass());
        for (String s:mp.keySet()) {
            System.out.println(s);
        }
    }

実行結果

class java.util.LinkedHashMap
a1
a2
0
0
0

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
0
0