title: How to avoid null insertion in ArrayList?
body: <p>How to avoid null insertion in ArrayList while inserting element?</p>
  
  <pre><code>ArrayList&lt;String&gt; al=new ArrayList&lt;String&gt;();
  al.add(null);//should avoid
  .
  .
  .
  al.add("Ramesh");
  </code></pre>