title: How to use ArrayUtils for array of objects, it doesn't delete the content of an array
body: <p>How to delete the content of an array of objects. If there is other ways to delete a content of an array of objects , please do share.  </p>
  
  <pre><code>import java.util.Arrays;
  import java.util.Scanner;
  
  import org.apache.commons.lang3.ArrayUtils;
  
  public class Testing {
  
    public static void deleteItem(ItemTracker[] listItems) {
      System.out.println("Which item you want to delete? ");
      for(int i=0; i &lt; listItems.length; i++) {
              if(input.equalsIgnoreCase("Quantity")) {
                  // Some Code
              } else if(input.equalsIgnoreCase("Something"){
                  ArrayUtils.remove(listItems, i); //  This is the part where it should delete .. but it doesnt delete. 
              } 
              break;
          }
        }
      }
  </code></pre>