title: Why null values are allowed inside java List
body: <p>If I am writing </p>
  
  <pre><code>List&lt;String&gt; list1 = new ArrayList&lt;String&gt;();
  list1.add(null);
  list1.add(null);
  </code></pre>
  
  <p>Java allows that . Why ??
  Any use of list1[0] will any way result into NPE . </p>