int x=0;
x=x++;
System.out.println("The Value Of X-->"+x);
It will print 0 but why?
If we write the following code,
int x=0,y=0;
y=x++;
System.out.println("The Value Of Y-->"+y);
System.out.println("The Value Of X-->"+x);
Then the output will be 0 and 1. My question is in my first code first I put the x value to 0 then increment x so the x which value is 0 is replaced by 1,so the result should be 1 but here we got result is 0.