I am trying to make a trivia game program for my Java class at school. I am new to Java and I'm trying to compare the string value of an index in one array (player's answers) against the string value of an index in another array(answer key) but I have no idea what expression to use to do this.
public static int player1_answer_check(String player1_answers) { int player1_correct, index = 0, counter = 0; do { if (player1_answers[index].equals(Question.get_answer_key(counter))) { player1_correct++; } else{ } index++; counter = counter + 2; } while (counter < 10); return player1_correct; }