I was wondering if there's a way to essentially look at the next position of a string index and determine if there's a value stored at that index, without being broken out of the loop with an exception if there isn't one?
String[] indexesList = new String[] {"Group 1", "MEAN", "Group 2", "SDEV"}
for(int inside = 2; inside < indexesList.legth; inside += 2) {
statementA.setObject(7, indexesList[inside]);
statementA.setObject(8, indexesList[inside + 1]);
}
With The previous snippet will throw an java.lang.ArrayIndexOutOfBoundsException: Index x out of bounds for length 4 error, and I was wondering if there's a way to accomplish going through each value in the list, check if there's another value present while on the current iteration, and continue without any exceptions if there isn't another value?