Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
hard Solved by 4 students

Pre and Post Increment Operator Evaluation

Mark
< Prev
Next >

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

public class MixedIncrement {
    public static void main(String[] args) {
        int x = 3;
        System.out.println(x++ + " " + ++x);
    }
}
A

4 5

B

Compilation Error

C

3 4

D

3 5

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1omar.nurdaulet2411 0m 00s 100
#26test6ing601 0m 00s -10
#3gopangjan89301 0m 06s -16
#4busemagngr01 0m 38s -48
#5lsj0803092211 2m 51s -71
Items per page:
10
1 – 5 of 5

AI Tutor

How can I help?

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