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
3 4
B
4 5
C
3 5
D
Compilation Error
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | omar.nurdaulet24 | 1 | 1 | 0m 00s | 100 |
| #2 | 6test6ing6 | 0 | 1 | 0m 00s | -10 |
| #3 | lsj08030922 | 1 | 1 | 2m 51s | -71 |
Items per page:
10
1 – 3 of 3
APFIVE