title: How to implement a remove method for an object array
body: <p>I know my add method is correct:</p>
  
  <pre><code>public void add(Object object) {
      if (!contains(object) &amp;&amp; size !=maxObjects) {
          set[size] = object; size++;
      }
      else 
          System.out.println("Already exists.");
  }
  </code></pre>
  
  <p>because I get print outs like:  </p>
  
  <pre><code>Set [maxObjects=8, set=[a, 7, null, null, null, null, null, null], count=2]  
  true  (I ask if it contains a value)  
  false  "                            "  
  Set [maxObjects=8, set=[a, 7, b, Valencia, 24, s, Victoria, null], count=7]  
  Set [maxObjects=8, set=[a, 7, b, Valencia, 24, s, Victoria, 4234], count=8]  
  </code></pre>
  
  <p>I have tried two different remove methods that are both the same (one I created; the other I found on Stack in the most similar problem a few days ago.)</p>
  
  <p>1st remove:</p>
  
  <pre><code>public boolean remove(Object object) {
      if (contains(object)) {
          object = null; 
          return true;
      }
      System.out.println("The object doesn't exist to delete.");
      return false;
  }
  </code></pre>
  
  <p>The other remove:</p>
  
  <pre><code>public boolean remove(object object) {
      for (int i=0; i&lt;(size-1); i++) {
          while (!contains(object) &amp;&amp; size &lt;= maxObjects) {
              set[i] = set[i+1]; size--; return true;
          }
      }
      System.out.println("Doesn't exist.");
      return false;
  }
  </code></pre>
  
  <p>Any help would be amazing!</p>