Although, the question looks to be just a homework and to which we do not respond, generally, but, here are the possibilities of such results which may help you understand the basics of increament.
Quote:
int x = 34;
int y = x++;
x is first assigned to y and then incremented by one. Therefore, x becomes 35 while y is assigned with the value 34.
Reference:
Increment and Decrement Operators - Java Tutorial - Java With Us[
^]
Now, when you assign the post-increamented value to the same variable it just assign the old value i.e, 0 to b in the following line-
b = b++;
So you are getting 0 as output.
Change the above line to just -
b++;
Try following code-
int b = 0;
b++;
System.out.println("Byte : "+b);
Hope, I was able to clarify your doubt. If not, please let me know :)