| preferred AP College board partner for AP classes
AP Computer Science A/Unit 2: Using Objects
Start Practice TestPractice Test
Share
About Exam
medium Solved by 1 students
Recursive String Method Output
< Prev
Next >

Consider the following RemoveVowels class. What is printed when the program is executed?

public class RemoveVowels {
    public static String remove(String s) {
        if(s.length() == 0) return "";
        if("AEIOUaeiou".indexOf(s.charAt(0)) != -1)
            return remove(s.substring(1));
        return s.charAt(0) + remove(s.substring(1));
    }
    public static void main(String[] args) {
        System.out.println(remove("Hello"));
    }
}
A

hll

B

Hll

C

Hello

D

Heo

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy