| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice Test
Share
easy Solved by 14 students
Java Array Length Field
< Prev
Next >

What is printed when the following code segment is executed?

public class ArrayLengthTest {
  public static void main(String[] args) {
      int[] values = {2, 4, 6, 8, 10};
      System.out.println(values.length);
  }
}
A

5

B

0

C

Compilation Error

D

4

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1mtanarupi22 0m 00s 200
#2geethasailaja22 0m 43s 157
#3singhris00011 0m 05s 95
#4suhanakochhar00611 0m 15s 85
#5y.seong202711 0m 22s 78
#6sailajavadlamani3311 2m 39s -59
#7bommasam00035 11m 50s -430
#8sathilak00011 18m 04s -984
APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy