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/']
You may create a new array (in this case, `filteredArray`) in which you store all the elements in `myArray` but the greatest two.
Also, it is better to save the indexes of the two biggest numbers rather than their values in order to be able to filter them out more easily.

This should work (you will find the array you want in `filteredArray`).

```
int n = sc.nextInt();
int [] myArray = new int[n];
int first = 0;
int second = 0;
for(int i = 0; i < myArray.length; i++) {
    myArray[i] = sc.nextInt();
    if (myArray[i] > myArray[first]) {
        second = first;
        first = i;
    } else if(myArray[i] > myArray[second]) {
        second = i;
    }
}
int [] filteredArray = new int[n-2];
int skipped = 0;
for(int i = 0; i < myArray.length; i++) {
    if(i != first && i != second)
        filteredArray[i - skipped] = myArray[i];
    else
        skipped++;
}

```
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);

```