LoginSignup
68
57

More than 3 years have passed since last update.

Javaの拡張ForループでMapをループ

Last updated at Posted at 2014-03-10

JavaでMap系のオブジェクトを拡張Forループで繰り返しする方法。
いつも書き方忘れてしまうのでメモです。

MapLoop.java
for(Map.Entry<String, String> entry : map.entrySet()) {
    System.out.println(entry.getKey());
    System.out.println(entry.getValue());
}
68
57
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
68
57