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

What value is printed by the program?

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

12

B

14

C

16

D

10

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1winstonhou110722 1m 06s 134
#2theofanusmischa01 1m 07s -77
#3suhanakochhar00611 3m 55s -135
#4bommasam00033 7m 35s -155
#5singhris00003 2m 26s -176
#6sathilak00014 5m 16s -246
#7y.seong202712 6m 18s -288
#8sailajavadlamani3311 12m 29s -649
#9geethasailaja23 1h 29m -5,193
APFIVE © 2020.
Email: [email protected]|Privacy Policy