Question: is there a difference between x++ and ++x in Java? I was looking at this problem and the second question kinda confused me.. What is
is there a difference between x++ and ++x in Java? I was looking at this problem and the second question kinda confused me..
What is assigned to the variable x at the end of each of these two sets of statements? What is the value of y after the last statement in each set is executed?
int x, y = 3; x = y++; // value of x: _____4_______ value of y: ____3________
int x, y = 3; x = ++y; // value of x: ____________ value of y: ____________
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
