Java Get Maximum Float Value

Tags: float

In this Java core tutorial we learn how to get the maximum float value in Java programming language.

How to get maximum float value in Java

In Java, to get the maximum float value we can use the Float.MAX_VALUE constant as the following example Java program.

GetMaxFloatExample.java

public class GetMaxFloatExample {
    public static void main(String... args) {
        // Get Maximum Float Value
        float maxFloat = Float.MAX_VALUE;

        System.out.println("Maximum Float Value: " + maxFloat);
    }
}
The output as below.
Maximum Float Value: 3.4028235E38

Happy Coding 😊

Java Get Minimum Float Value