title: What is the use of LinkedHashMap.removeEldestEntry?
body: <p>I am aware the answer to this question is easily available on the internet. I need to know what happens if I choose not to <code>removeEldestEntry</code>. Below is my code:</p>
  
  <pre><code>package collection;
  
  import java.util.*;
  
  public class MyLinkedHashMap {
  
     private static final int MAX_ENTRIES = 2;
  
     public static void main(String[] args) {
        LinkedHashMap lhm = new LinkedHashMap(MAX_ENTRIES, 0.75F, false) {
  
           protected boolean removeEldestEntry(Map.Entry eldest) {
              return false;
           }
        };
        lhm.put(0, "H");
        lhm.put(1, "E");
        lhm.put(2, "L");
        lhm.put(3, "L");
        lhm.put(4, "O");
  
        System.out.println("" + lhm);
  
     }
  }
  </code></pre>
  
  <p>Even though I am not allowing the <code>removeEldestEntry</code> my code works fine.
  So, internally what is happening?</p>