Im using an ArrayList and im trying to copy a part of it to another ArrayList therefore im using:
sibling.keys = (ArrayList<Integer>) keys.subList(mid, this.num);
Where "sibling.keys" is the new ArrayList and "keys or this.keys" is the older ArrayList.
I used the casting because eclipse told me to do that but then it throws a ClassCastException:
java.util.ArrayList$SubList cannot be cast to java.util.ArrayList
Any advice?