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 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

15

B

20

C

5

D

10

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1bommasam00024 1m 08s 112
#2khanhnguyen.thor11 1m 34s 6
#3ntgamja101 0m 52s -62
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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