Originally posted by Thomas Markl:
Why don't I get the error before?
If I understand your question correctly, you are asking why:
float x = 1;
is ok.
int y = 1.0F
is not.
The reason is you can upcast implicitly. But when you want to downcast, your have to be explicitly.
So,
int y= (int)1.0F
will work.