Float.NEGATIVE_INFINITY in Java

Float.NEGATIVE_INFINITY: This is available in java.lang.Float class of Java.

Syntax:

float java.lang.Float.NEGATIVE_INFINITY

A constant holding the negative infinity of type float (i.e -Infinity).

Approach

Java

public class FloatNegativeInfinity {
    public static void main(String[] args) {

        System.out.println(Float.NEGATIVE_INFINITY);

    }
}

Output:

-Infinity

No comments:

Post a Comment