Create LinkedHashMap Object and add value to it - Java Collection Framework

Java examples for Collection Framework:LinkedHashMap

Description

Create LinkedHashMap Object and add value to it

Demo Code

 
import java.util.LinkedHashMap;
 
public class Main {
 
  public static void main(String[] args) {
    LinkedHashMap lHashMap = new LinkedHashMap();
    lHashMap.put("One", new Integer(1));
    lHashMap.put("Two", new Integer(2));
    Object obj = lHashMap.get("One");
    System.out.println(obj);  //from   w ww.  j  a  v a 2s. co  m
  }
}

Result


Related Tutorials