Which code fragment cause a compilation error?

Which code fragment cause a compilation error?

Which code fragment cause a compilation error?

A.
float flt = (float) 1_11.00;

B.
int y2 = 100; floatflt = (float) y2;

C.
flat flt = 100F;

D.
float flt = 100;

E.
double y1 = 203.22; floatflt = y1



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Kevin

Kevin

D not A, tried it.

You cannot compile without converting from double to float.