Question: I am working in java and I wrote this statement: float width = 4.5; it gave me a issue and said can not convert a

I am working in java and I wrote this statement:

float width = 4.5;

it gave me a issue and said can not convert a double to a float.

what is the difference b/t a float and double?

and why am i having this issue? i thought a float is a decimal point

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!