public class ForTest {
public static void main(String[] args){
int y = 0;
int x = y++ + y*5;
System.out.println(x);
}
}
Why is the output of this expression equal to fiveL I understand that the y++
takes precedence so y*5
equals 5
, but in that case shouldn't x
equal 6
? My conundrum is that if y*5
equals 5
than doesn't that imply that y
has already incremented and thus meaning that x
should equal 6?