Primitive Type Assignment Errors
Which of the following code snippets will cause a compile-time error?
I.
int x = 5.5;
II.
double x = 5.5;
int y = (int) x;
III.
double x = 5.5;
int y = x;
A
None
B
III only
C
II only
D
I and III only
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | lsj08030922 | 3 | 3 | 0m 36s | 264 |
| #2 | chunxiangxu.cxu | 2 | 2 | 1m 13s | 127 |
| #3 | waynechen0110 | 1 | 1 | 0m 00s | 100 |
| #4 | sailajavadlamani33 | 1 | 1 | 0m 00s | 100 |
| #5 | l.alzahrani04 | 1 | 1 | 0m 00s | 100 |
| #6 | liuwilliam072410 | 1 | 1 | 0m 07s | 93 |
| #7 | varunrajaram1 | 1 | 2 | 0m 00s | 90 |
| #8 | jackgreanias364 | 1 | 1 | 0m 15s | 85 |
| #9 | sgarv2513 | 1 | 3 | 0m 00s | 80 |
| #10 | kimtrinhqldacamle | 1 | 1 | 0m 23s | 77 |
Items per page:
10
1 – 10 of 36
APFIVE