Java examples for Language Basics:double
How to use isNaN() method of the Double class
public class Main { public static void main(String[] args) { double d = Math.sqrt(-10); boolean b1 = Double.isNaN(d); System.out.println(b1);//from w w w.j a va 2 s .c o m Double dObj = new Double(d); boolean b2 = dObj.isNaN(); System.out.println(b2); } }