Which of the following are not a valid declarations? A1 float f = 1; A2 float f = 1.2f; A3 float f = 1.2; A4 float f = (float)1.2; In this case float f =1 is a valid declaration. Can any one help me why this declaraion is a valid declaration.
posted 9 years ago
This is a Widening Primitive Conversion. int types can be implicitly converted to float, double and long. Please, check the following articles: