| 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 4 students
Enhanced For Loop With Primitives
< Prev
Next >

What is the output of the code above?

public class ModifyEnhanced {
  public static void main(String[] args) {
      int[] data = {10, 20, 30};
      for (int num : data) {
          num += 5;
      }
      System.out.println(data[0]);
  }
}
A

10

B

5

C

15

D

20

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1bommasam00024 1m 08s 112
#2khanhnguyen.thor11 1m 34s 6
#3ntgamja101 0m 52s -62
Items per page:
10
1 – 3 of 3

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy