Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice TestPractice Test
About Exam
medium Solved by 12 students

Java Array Default Initialization

Mark
< Prev
Next >

What is printed when the following code segment is executed?

public class ArrayDefault {
    public static void main(String[] args) {
        int[] nums = new int[5];
        System.out.println(nums[2]);
    }
}
A

5

B

null

C

0

D

ArrayIndexOutOfBoundsException

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1bommasam00048 2m 12s 228
#2winstonhou110723 0m 40s 150
#3kshiva2009m23 0m 55s 135
#4kazvin.tjakradinata11 0m 04s 96
#53000666111 0m 09s 91
#6tfvhygdj11 0m 10s 90
#7sailajavadlamani3311 0m 22s 78
#8vempaami00011 0m 39s 61
#9geethasailaja44 5m 54s 46
#102023167901 0m 07s -17
Items per page:
10
1 – 10 of 14

AI Tutor

How can I help?

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