Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 2: Using Objects
Start Practice TestPractice Test
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

Heo

B

hll

C

Hello

D

Hll

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question
Mark for review

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

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