Example
java
float myNum = 5.75f;
System.out.println(myNum);
Definition and Usage
The float keyword is a data type that can store fractional numbers from 3.4e−038 to 3.4e+038.
Note that you should end the value with an "f":
The `float` keyword is a data type that can store fractional numbers from 3.4e−038 to 3.4e+038.
float myNum = 5.75f;
System.out.println(myNum);
The float keyword is a data type that can store fractional numbers from 3.4e−038 to 3.4e+038.
Note that you should end the value with an "f":