Please enable JavaScript to use CodeHS

Want to receive Question of the Day updates? Subscribe Here

AP CSA Question of the Day March 20, 2025

Reference
  1. Incorrect Correct No Answer was selected Invalid Answer

    Given the following function:

    public String mystery(String s) 
    {
        if (s.length() == 2) 
        {
            return s;
        }
        return mystery(s.substring(1)) + s.substring(0,1);
    }
    Java

    What would be printed from the following statement?

    System.out.println(mystery("CodeHS"));
    Java