Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

AP CSA Question of the Day Feb. 24, 2025

Reference
  1. Incorrect Correct No Answer was selected Invalid Answer

    What does the following method do?

    public boolean test(String[][] arr, String key) {
        for(int row = 0; row < arr.length; row++) {
            for(int col = 0; col < arr[0].length; col++) {
                if (key.equals(arr[row][col])) {
                    return true;
                }
            }
        }
        return false;
    }
    Java