You may simplely use scanner.nextLine() to get a string and then compare it with "Yes" or "Y" and "No" or "N".