Given java code:
private List<String> list_from = new ArrayList<String>();
private List<String> list_dest = new ArrayList<String>();
values of list_from
is:
[v5, v3, v5, v1, v1, v6, v6, v3, v4, v5, v4, v6]
values of list_dest
is:
[v3, v5, v1, v5, v6, v1, v3, v6, v5, v4, v6, v4]
I'm using loop for to print out the values in list_from with an if statement:
for(int i=0;i < list_from.size();i++){
if(list_dest.get(i+1) == list_from.get(i)){
System.out.println(list_from.get(i));
}
}
it gives out a correct result but with unknown error at an if statement.
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 18, Size: 18
Thank you so much for your help!