In this example we will show the method to create a float type in Java.
Source Code
package com.beginner.examples;
public class FloatType {
public static void main(String[] args) {
float num = 4.28f; // float
System.out.println(num);
}
}
Output:
4.28