Out of curiosity I just decompiled below code using DJ Java Decompiler as well using CAVAJ Java Decompiler ( Java version is 1.7 ) here is the normal source code :
byte a = 10;
a = (byte) (a +1);
byte b = 10;
b = b++;
byte c = 10;
c +=c;
System.out.printf("a=%d \t b=%d \t c=%d\n",a,b,c);
Which shows output as: a=11 b=10 c=20
And here is the decompiled one:
byte a = 10;
a++;
byte b = 10;
b++;
b = b;
byte c = 10;
c += c;
System.out.printf("a= %d \t b = %d \t c = %d\n", new Object[] {
Byte.valueOf(a), Byte.valueOf(b), Byte.valueOf(c)
});
Which when used as source code output as: a=11 b=11 c=20
To be more clear it has nothing to do with byte same thing happening for int as well and I even checked above codes in online compiler IDEONE and giving the same output as mine.
So, is the decompiler producing wrong code or is something else ??
b=b++;inb++;b=b;.