| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice TestPractice Test
About Exam
hard Solved by 13 students
Array Indexing with Post-Increment
< Prev
Next >

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

public class IncrementArray {
    public static void main(String[] args) {
        int[] values = {2, 4, 6, 8};
        int i = 0;
        int result = values[i++] + values[i++] * 2;
        System.out.println(result);
    }
}
A

10

B

14

C

12

D

16

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1winstonhou110722 1m 06s 134
#2kazvin.tjakradinata13 2m 00s -40
#3midnightasdark13 2m 24s -64
#4Pelisx01 1m 02s -72
#5theofanusmischa01 1m 07s -77
#6tellabhinaya01 1m 43s -113
#7suhanakochhar00611 3m 55s -135
#8bommasam00033 7m 35s -155
#9singhris00003 2m 26s -176
#10sathilak00014 5m 16s -246
Items per page:
10
1 – 10 of 13
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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