I want to know that i have a some lines code that gave this error were the assignments of 9.0 to g.
Float g = 9.0; and
g = 9.0; float is a floating point number yet the line which assigned the 9 value to f compiles correctly while the assignment of 9.0 to g doesn't! This is definitely counter intuitive! The error is
"Error 1 Literal of type double cannot be implicitly converted to type 'float'; use an 'F' suffix to create a literal of this type".

Karthik AgarwalPosted Nov 24, 2011, 11:58 AM
We should do one of the following:
* Explicitly cast from double to float:
float d = (float)3.8;
* Use f to indicate that the literal is a float not a double
float d = 9.0F;
Karthik AgarwalPosted Nov 24, 2011, 11:55 AM
float g = 9.0F;