Java tutorial
import java.util.LinkedHashMap; public class MainClass { public static void main(String[] args) { LinkedHashMap linkedMap = new LinkedHashMap(); for (int i = 0; i < 10; i++) { linkedMap.put(i, i); } System.out.println(linkedMap); // Least-recently used order: linkedMap = new LinkedHashMap(16, 0.75f, true); for (int i = 0; i < 10; i++) { linkedMap.put(i, i); } System.out.println(linkedMap); for (int i = 0; i < 7; i++) // Cause accesses: System.out.println(linkedMap.get(i)); System.out.println(linkedMap); } }