If you have a computer with a JDK installed, then you can very quickly find the answer to this question yourself. Just write a very small program and try to compile it, and see which of these compiles and which ones give you an error.
Whether an assignment to a
float is valid has nothing to do with if the value of the number is big or small. It's about the types.
The Java Language Specification specifies the rules about what types of values can be assigned to a different type of variable without casting or explicit conversion.
The literal values on the right side of the = in answers A and B are of type
double. Converting these values to a
float means you are doing a
narrowing primitive conversion, which requires a cast. The cast is required because such a conversion throws away part of the value (bits are discarded), so, with a cast, you must confirm to the compiler that that's OK.
The literal values on the right side of the = in answers C, D and E are of type
int. Converting these values to a
float means that you are doing a
widening primitive conversion, which does not require a cast.
Whether these questions will be on the exam, is something I don't know for sure.