Java入門|HashMapとIteratorの使い方
Javaコード:
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class Studyit {
public static void main(String[] args) {
Map<String, String> map = new HashMap<String, String>();
map.put(“birth_yy", “1982");
map.put(“birth_mm", “09");
map.put(“birth_dd", “25");
System.out.println(“誕生日:");
for (Iterator iterator = map.values().iterator(); iterator.hasNext();) {
String strBirth = (String) iterator.next();
System.out.println(strBirth);
}
}