Will the following code compile (as a part of the method):

int a;
float b = 3.14;
a = b;
Explanation
Yes, but the compiler will likely issue a warning about the loss of accuracy. More information about type conversions: Type conversions

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback