title: In java to remove an element in an array can you set it to null?
body: <p>I am trying to make a remove method that works on an array implementation of a list. 
  Can I set the the duplicate element to null to remove it? Assuming that the list is in order.</p>
  
  <pre><code>ArrayList a = new ArrayList[];
  
  public void removeduplicates(){
  
      for(a[i].equals(a[i+1]){
  
          a[i+1] = null;
  
      }
      a[i+1] = a[i];
  }
  </code></pre>