Primitive type

float primitive

A binary32 floating-point value. An f or F suffix makes a floating-point literal a float.

Formal Syntax & Structure

java syntaxjava
float name = expression;

Working Example

Example Snippetjava
public class Main {    public static void main(String[] args) {        float distance = 1.5f;        System.out.println(distance);    }}
Java Reference