I have a problem with this code
List<String> listaTags = new ArrayList<String>();
int i = 0;
String current = listaTags.get(i);
while (listaTags.size() > 1 && listaTags.contains("/".concat(current)) != current.contains("/")) {
if (current.equals(listaTags.get(i + 1))) {
listaTags.remove(current);
listaTags.remove(listaTags.get(i + 1));
if (i < 0) {
i++;
}
}
i++;
}
System.out.println("errore nel codice");
}
listatags
has six elements
the error is:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 6,Size: 6
Can somebody help me?