| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice TestPractice Test
Share
About Exam
medium Solved by 5 students
Recursive String Concatenation
< Prev
Next >

What does the program print when the main method is executed?

public class CapConcat {
    public static String capConcat(String[] arr, int index) {
         if(index == arr.length) return "";
         return arr[index].toUpperCase() + capConcat(arr, index + 1);
    }
    public static void main(String[] args) {
         String[] words = {"java", "code"};
         System.out.println(capConcat(words, 0));
    }
}
A

JAVACODE

B

JAVA CODE

C

javacode

D

java code

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: [email protected]|Privacy Policy