/**
数组去重
相邻的2个数字要是相同只保留一个
* @author Administrator
*
*/
public class ArrayPaichong {
public static void main(String[] args) {
int[] in=new int[] {1,2,2,3,4,5,2,4,4,7,7};
List a=new ArrayList();
for(int i=0;i<in.length;i++) {
int temp1=in[i];
if(i+1<in.length) {
int temp2=in[i+1];
if(temp1!=temp2) {
a.add(temp1);
}
}else {
a.add(temp1);
}
}
System.out.println(a.toString());
}
}