You either need to use an indexed loop.
for(int i=0;i<strings.length-1;i++) {
String curr = strings[i];
String next = strings[i+1];
}
or you need to compare the current to the previous not the next.
String curr = null;
for(String next: strings) {
if (curr != null) {
// compare
}
curr = next;
}