float java
float pi = 3.1415f; // put "f" at the end
Modern Mosquito
float pi = 3.1415f; // put "f" at the end
Primitive types are the most basic data types available within the Java language. There are 8: boolean , byte , char , short , int , long , float and double . These types serve as the building blocks of data manipulation in Java. Such types serve only one purpose — containing pure, simple values of a kind.
class Main {
public static void main(String[] args) {
float number = -42.3f;
System.out.println(number); // prints -42.3
}
}