title: Creating Hashtable as final in java
body: <p>As we know the purpose of "final" keyword in java. While declaring a variable as final, we have to initialize the variable. like "<strong>final int a=10;"</strong>
     We can not change the value of "a". But if we go for HashTable its possible to add some value even declaring the HashTable as final.</p>
  
  <p>Example::</p>
  
  <pre><code> private static final Hashtable&lt;String,Integer&gt; MYHASH = new Hashtable&lt;String,Integer&gt;() 
  {{     put("foo",      1);     
         put("bar",      256);     
         put("data",     3);     
         put("moredata", 27);     
         put("hello",    32);     
         put("world",    65536);  }}; 
  </code></pre>
  
  <p>Now I am declaring the MYHASH HashTable as final. If I try to add some more elements to this, its accepting.</p>
  
  <pre><code>MYHASH.put("NEW DATA",      256);
  </code></pre>
  
  <p>Now the "NEW DATA" is added to the HashTable.
  My questions is Why its allowing to add even its declaring as final????</p>