I though it was float | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I though it was float

what's double

19th Aug 2017, 3:42 PM
Roy Choi
Roy Choi - avatar
3 Answers
+ 3
double can have much larger numbers than float. Don't use it unless you actually need it. Both are numbers with/without a decimal point
19th Aug 2017, 3:51 PM
Jordan Chapman
Jordan Chapman - avatar
+ 3
Double > Float By default decimal numbers are of type double in Java. So : float a = 1.5; Will give an error, unless you cast the double to a float someway. Like: float a = 1.5f;
19th Aug 2017, 4:02 PM
Rrestoring faith
Rrestoring faith - avatar
0
float double is datatype
19th Aug 2017, 3:57 PM
Sarifudin Z
Sarifudin Z - avatar