I am trying to get an index 466in an arrayListminuteList
[288, 318, 346, 376, 406, 436, 466, 1006, 1036, 1066, 1096, 1126, 1156]
but I get this error:
java.lang.IndexOutOfBoundsException: Index: 466, Size: 13
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at com.pdf.PDF.refill_time_table(PDF.java:155)
at com.pdf.PDF.main(PDF.java:54)
I debugged it, and minuteListhas the values above, and the variable elementmatters 466. How can i fix this?
I appreciate any help.
The code:
Collections.sort(diffArray);
int element = diffArray.get(diffArray.size() - 1).getElement();
int nextElement = diffArray.get(diffArray.size()-1).getNextElement();
minuteList.get(element);
source
share