Float and Double data type

Dear Sir,
Why do in java we have both float and double data type? Because function of both is to store decimal number.
Thank You.

Hii Mohit,
This is because the range of float and double is different.

Is there any difference in manner in which float and double number are converted to binary that makes size of both different from each other.

Hii Mohit,
See conversion of long or int to binary number remains same but the difference is only the range. Same is the case with float and double.

Thank you sanyam jain, I understand.