Today, helping someone, I ran into an interesting problem that I could not understand. When using + =, we do not need to explicitly create a casting, but when we use i + i, we need to use it explicitly. Could not find the exact reason. Any input would be appreciated.
public class Test{ byte c = 2; byte d = 5; public void test(String args[]) { c += 2; d = (byte) (d + 3); } }
source share