In java, the compiler throws an error if you try to assign a double literal to an int variable. However, it allows the assignment of an int literal to variable of type long.
double d = 4.0;
float f = d; // this is not allowed. 4.0 should be 4.0f
int i = 4;
long x = i; // this is allowed. 4 is treated same as 4L