title: Adding null values to arraylist
body: <p>Can I add <code>null</code> values to an <code>ArrayList</code> even if it has a generic type parameter?</p>
  
  <p>Eg.</p>
  
  <pre><code>ArrayList&lt;Item&gt; itemList = new ArrayList&lt;Item&gt;();
  itemList.add(null);
  </code></pre>
  
  <p>If so, will</p>
  
  <pre><code>itemsList.size();
  </code></pre>
  
  <p>return 1 or 0?</p>
  
  <p>If I can add <code>null</code> values to an <code>ArrayList</code>, can I loop through only the indexes that contain items like this?</p>
  
  <pre><code>for(Item i : itemList) {
     //code here
  }
  </code></pre>
  
  <p>Or would the for each loop also loop through the null values in the list?</p>