import java.util.*;
public class List1 extends ArrayList{
public static void main(String[] args) {
String ar[]={"india","pakistan","United Kingdom","Japan"};
List1 list=new List1();
list.add(ar[0]);
list.add(ar[1]);
list.add(ar[2]);
list.add(ar[3]);
System.out.println(list);
list.removeRange(0,2);
System.out.println(list);
}
}
Output
[india, pakistan, United Kingdom, Japan]
[United Kingdom, Japan]
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.