0
Why there is 4.2 before the f
3 Answers
+ 2
Decimal numbers by default are doubles, but by adding f to the end of the decimal number you tell the program that the decimal number is a float instead.
Double and float are both decimal numbers, but they have a difference:
Doubles can have 15 decimal places.
Floats can have 7 decimal places.
4.2 would be a double
4.2f would be a float
+ 1
Thank you jamie