Computer Science, asked by shaunxylo, 11 months ago

write a java statement to assign 255.6 to a float type variable​

Answers

Answered by yash777star
3

Answer:

float a=(float)255.6;

Explanation:

you need to explicitly define (float) otherwise it will give an error of 'loss of precision' as any number having a decimal is treated as double.

Similar questions