Pre and Post Increment Operator Evaluation
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
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | omar.nurdaulet24 | 1 | 1 | 0m 00s | 100 |
| #2 | 6test6ing6 | 0 | 1 | 0m 00s | -10 |
| #3 | gopangjan893 | 0 | 1 | 0m 06s | -16 |
| #4 | busemagngr | 0 | 1 | 0m 38s | -48 |
| #5 | lsj08030922 | 1 | 1 | 2m 51s | -71 |
Items per page:
10
1 – 5 of 5
