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   ww  w .  j  a  va2 s. c  o m
  }
}

Result


Related Tutorials