Primitive Type Assignment Errors
Which of the following pairs of declarations will cause an error message?
I.
int x = 5.5;
II.
double x = 5.5;
int y = (int) x;
III.
double x = 5.5;
int y = x;
A
II only
B
None
C
III only
D
I and III only
Which of the following pairs of declarations will cause an error message?
I.
int x = 5.5;
II.
double x = 5.5;
int y = (int) x;
III.
double x = 5.5;
int y = x;
II only
None
III only
I and III only