I am trying to use removeRange method for removing certain elements from ArrayList. I got to know about this method from here: http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#removeRange(int, int)
However when I tried it like this
ArrayList<String> al = new ArrayList<String>();
al.add("AB");
al.add("BC");
al.add("CD");
al.add("DE");
al.removeRange(1, 3);
I got this error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method removeRange(int, int) from the type ArrayList<String> is not visible
Why am I not able to use this method? Am I doing something wrong?