A literal 123has a intdefault value , not a double. There is no need to assign a literal intto float, since this requires an extension of the primitive transform.
When you assign an expression value to a variable, the following assignments are allowed:
JLS 5.2. :
(§15.26) ; .
:
JLS 5.1.2.
19 :
byte , int, long, float double
short int, long, float double
char int, long, float double
int ,
...