title: How to remove an object from an array in Java?
body: <p>I have written this code but I want to delete the route[mini][minj] and route[mini+1][minj] I want it to find the minimum every time delete that and find the minimum in others.</p>
  
  <pre><code>class Test {
  public static void main(String[] args) {
      int x=3;
      int y=5;
      double d=0;
      double p=0;
      double min=1000;
      int mini=0;
      int minj=0;
      int b=0;
      int[][] route = new int[][]{
        {20,50,72,63,54,33,22,93,52,70},
        {67,56,46,37,39,29,15,11,13,71},
      };
      int[][] distance = new int[10][10];
      while (b&lt;10) {
      for (int i=0;i&lt;route.length-1;i++) {
          for (int j=0;j&lt;route[0].length;j++) {
              distance[i][j]=route[i][j]-x;
              distance[i+1][j]=route[i+1][j]-y;
              p=Math.sqrt((distance[i][j])*(distance[i][j])+((distance[i+1][j])*(distance[i+1][j])));
              //System.out.println(p);
              if (min&gt;=p) {
                  min=p;
                  mini=i;
                  minj=j;
              }
          }
      }
      b++;
      }
  }
  </code></pre>
  
  <p>}
  I searched for it but none of the answers seem to work for my situation.</p>