LinkedHashMap: values() : LinkedHashMap « java.util « Java by API






LinkedHashMap: values()

 
       
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;

public class Main {
  public static void main(String[] args) {
    LinkedHashMap<String,String> lHashMap = new LinkedHashMap<String,String>();

    lHashMap.put("1", "One");
    lHashMap.put("2", "Two");
    lHashMap.put("3", "Three");

    Collection c = lHashMap.values();
    Iterator itr = c.iterator();

    while (itr.hasNext()){
      System.out.println(itr.next());
    }
  }
}

   
  








Related examples in the same category

1.new LinkedHashMap()
2.new LinkedHashMap(int initialCapacity, float loadFactor, boolean accessOrder)
3.LinkedHashMap: clear()
4.LinkedHashMap: containsKey(Object key)
5.LinkedHashMap: containsValue(Object value)
6.LinkedHashMap: get(Object key)
7.LinkedHashMap: put(K key, V value)
8.LinkedHashMap: remove(Object key)
9.LinkedHashMap: size()