private static int getStateInfo(String state, String[][] states) {
private static int getStateInfo(String state, String[][] states) {
for (int i = 0; i < states.length; i++) {
//Remove leading and trailing spaces and verify input to array
if (state.trim().equalsIgnoreCase(states[i][0])) {
return i;
}
}
return -1;
}
This method confuses me…
I don’t understand how the integer getStateInfo has two strings in parenthesis after,
I also don’t understand what is happening when the program says return -1.. -1 of what?