java.util.LinkedHashMap.LinkedHashMap()のサンプル

サンプルコード:
package com.arkgame.study;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;

public class LinkedHaspMapDemo {

public static void main(String[] args) {

Map<String, String> cm = new LinkedHashMap<String, String>();
cm.put(“oosaka", “大阪");
cm.put(“tokyo", “東京");
cm.put(“fukuoka", “福岡");
Iterator cft = cm.keySet().iterator();
while (cft.hasNext()) {
System.out.println(cft.next());
}
}

}
結果
oosaka
tokyo
fukuoka

Java

Posted by arkgame