Which is the first line to trigger a compiler error?
double d1 = 5f; // p1 double d2 = 5.0; // p2 float f1 = 5f; // p3 float f2 = 5.0; // p4
D.
Java uses the suffix f to indicate a number is a float.
Java automatically widens a type, allowing a float to be assigned to either a float or a double.
This makes both lines p1 and p3 compile.
Line p2 does compile without a suffix.
Line p4 does not compile without a suffix and therefore is the answer.