Java examples for Language Basics:double
Check whether the argument primitive double value is infinite number or not
public class Main { public static void main(String[] args) { double d = (double) 4/0; boolean b1 = Double.isInfinite(d); System.out.println(b1);//from w ww . java2s. co m Double dObj = new Double(d); boolean b2 = dObj.isInfinite(); System.out.println(b2); } }