I can fill my array,and found the two of biggest numbers.But,i can not delete it.May u guys could help me?

```
  int n = sc.nextInt();
  int [] myArray = new int[n];
  int first = 0;
  int second = 0;
       for(int i = 0; i < myArray.length; i++) {
    int num = sc.nextInt();`
       if (num > first) {
         second = first;
         first = num;
    } else if(num > second) 
      {
      second = num;
      }
     }

   System.out.println("The largest  " + first+ "The second largest  " + second);

```
['https://Stackoverflow.com/questions/42713907', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7513001/']
Sort your arrays (default sort is ascending, i.e. from smallest to largest) then make a new copy of the array without the last two elements.

```
if(myArray.length > 2) {
    Arrays.sort(myArray);
    myArray = Arrays.copyOf(myArray, myArray.length-2);
} else {
    throw new IllegalArgumentException("Need moar elements in array!");
}

```

Then perform any calculations on the resulting array. If you want to keep the original array, don't overwrite `myArray` when doing `copyOf()`.
May be following code will useful for you 

```
again :
for (int i = 0; i < n; i++) 
{            
     if ((a[i] < a[i+1]) && (i+1)<n)  
     {
         temp = a[i];
         a[i] = a[i+1];
         a[i+1] = temp;
         continue again;
     }           
}
System.out.println("The largest  " + a[0] + " & second largest " + a[i]);

```

IF you want to delete other then you can do that 

```
for(int i=2; i<n ; i++)
   test = ArrayUtils.remove(a, i);

```