2.4.3.Compiler does not object to add an int value to a byte because it performs an explicit cast
public class MainClass { public static void main(String[] argv) { byte b = 0;
b += 27;
b = b + 27;
b = (byte) (b + 27);
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from int to byte
at MainClass.main(MainClass.java:5)