Java examples for Language Basics:float
boolean isInfinite(float) static method checks whether the argument primitive float value is infinite number or not.
It return true if the specified argument is infinite value, false otherwise.
public class Main { public static void main(String[] args) { float f = (float) 1/0; boolean b1 = Float.isInfinite(f); System.out.println(b1);/*ww w .j a v a2s .c om*/ Float fObj = new Float(f); boolean b2 = fObj.isInfinite(); System.out.println(b2); } }