What does post-increment leave in result?
int value = 1;
int result = value++;
System.out.println(result);Answer & explanation
Answer: 1
Post-increment evaluates to the old value, then increments the variable.
Practice operators with self-contained questions. Check your answer, then use the explanation to understand the reasoning.
int value = 1;
int result = value++;
System.out.println(result);Answer: 1
Post-increment evaluates to the old value, then increments the variable.