| 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 3 students
Array Initialization and Default Values
< Prev
Next >

What is printed as a result of executing the following code segment?

public class ObjectArray {
    public static void main(String[] args) {
        String[] words = new String[3];
        words[0] = "Hello";
        words[1] = "World";
        System.out.println(words[0] + " " + words[2]);
    }
}
A

Hello null

B

Hello

C

Hello World

D

null World

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