I have a sorted array of integers and want to remove the duplicates, I wrote the following code

```
package practice;
import java.util.*;

public class pb1 {

public static void removeDup(int[] theArray){       

    ArrayList<Integer> hold=new ArrayList<Integer>();

    for(int i=0;i<theArray.length-1;i++){

            hold.add(theArray[i]);

            //System.out.println(hold);

}
    for(int i=0;i<hold.size()-1;i++){
        if(hold.get(i)==hold.get(i+1)){
            hold.remove(i);
        }

    }
    System.out.println(hold);
}

public static void main(String[]args){
    int[] now={1,1,2,2,3,4,4,4,5,5,5,5};
    removeDup(now);

}

}

```

trying to delete the duplicates using the arraylist.remove method, but I can still see duplicates in my printed arraylist. I dont know why, pls can someone help me? thanks