Java examples for Collection Framework:LinkedHashMap
Get Size of LinkedHashMap
import java.util.LinkedHashMap; public class Main { public static void main(String[] args) { LinkedHashMap lHashMap = new LinkedHashMap(); System.out.println("Size of LinkedHashMap : " + lHashMap.size()); //from w ww . j ava2 s . co m lHashMap.put("1","One"); lHashMap.put("2","Two"); lHashMap.put("3","Three"); System.out.println("Size of LinkedHashMap after addition : " + lHashMap.size()); Object obj = lHashMap.remove("2"); System.out.println("Size of LinkedHashMap after removal : " + lHashMap.size()); } }