What data types will allow the following code snippet to compile? (Choose all that apply)
byte x = 1; byte y = 2; _____ z = x + y;
A, B, D.
x and y are both type of byte.
x + y is automatically promoted to int.
int and data types that can be promoted automatically from int will make the code compile.
A, B, D are correct answers.
C is wrong since boolean is not a numeric data type.
E and F will work for a casting. They are smaller data type.