Select from following answers:- Yes, It Will Compile without an error
- No, It will not Compile

- Data Insufficient
- All Above
No the above code will not compile since Double is a larger data type than integer.Here the Implicit conversion is not done since there would be a data loss.
It should be written like this which is an Explicit conversion.
double d = 5689.56;
int i = (int)d;
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator