title: How to remove elements from an array in java even if we have to iterate over array or can we do it directly?
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/112503/how-do-i-remove-objects-from-an-array-in-java">How do I remove objects from an Array in java?</a><br>
    <a href="https://stackoverflow.com/questions/642897/removing-an-element-from-an-array-java">Removing an element from an Array (Java)</a>  </p>
  </blockquote>
  
  
  
  <pre><code>listOfNames = new String [] {"1","2","3","4"}; //
  String [] l = new String [listOfNames.length-1];
  for(int i=0; i&lt;listOfNames.length-1; i++)    //removing the first element
     l[i] = listOfNames[i+1];
  </code></pre>
  
  <p>// can this work , Is there a better way ? to remove certain elements from an array in this case the first one .</p>