import java.util.*;
public class List1 {
public static void main(String[] args) {
Integer ar[]={111,222,333,444};
List list=new ArrayList();
list.add(ar[0]);
list.add(ar[1]);
list.add(ar[2]);
list.add(ar[3]);
System.out.println("With all element "+list);
list.remove(ar[0]);
System.out.println("after removal of first index"+list);
list.remove(2);
System.out.println("after removal of index 2"+list);
}
}
Output
With all element [111, 222, 333, 444]
after removal of first index[222, 333, 444]
after removal of index 2[222, 333]
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.