List 根据下标删除元素

Object[] inPa = { "9527", "201712", "201711", "255451"};
List inpal = Arrays.asList(inPa);
Object[] de= {1,2};
List del= Arrays.asList(inPa);//需要删除的下标
List outPa = new ArrayList();
for (int i = 0; i < inpal.size(); i++) {
	if(!de.contains(i)){
		outPa.add(inpal.get(i));
	}
}
System.out.println("删除后的List : " + outPa.toString());


 
  

                            
                        
                    
                    
                    

你可能感兴趣的:(java,list)