import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashMap; public class Demo { public static void main(String[] args) { LinkedHashMap<String,String>lHashMap = new LinkedHashMap<String,String>(); lHashMap.put("1", "A"); lHashMap.put("2", "B"); lHashMap.put("3", "C"); lHashMap.put("4", "D"); lHashMap.put("5", "E"); lHashMap.put("6", "F"); lHashMap.put("7", "G"); lHashMap.put("8", "H"); lHashMap.put("9", "I"); Collection collection = lHashMap.values(); Iterator i = collection.iterator(); while (i.hasNext()){ System.out.println(i.next()); } } }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more