Which of the following lines will compile without warning or error
-
float f=1.3;
-
int i=10;
-
char c="a";
-
byte b=257;
-
boolean b=null;
B
Correct answer
Explanation
Only option B compiles cleanly. Option A requires 1.3f to avoid loss-of-precision warning. Option C uses double quotes for String instead of single quotes for char. Option D overflows byte range (-128 to 127). Option E is invalid because boolean is a primitive type and cannot be assigned null.