What change would allow the following code snippet to compile? (Choose all that apply)
long x = 1; // line 3 int y = 2 * x; // line 4
2 * x
on line 4 to int. B, C, D, F.
A is not correct.
The code will not compile as is since the 2 * x promotes to long. The value 2 * x is promoted to long and cannot be automatically stored in y, which is in an int value.
B, C, and D changed the long value to int.
E is wrong since it makes the value in a smaller data type.
F solves the problem by increasing the data type to long, which is allowed.