How to use isInfinite() method with Double object in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
  
        double d = (double) 1/0;
        Double dObj = d;
        boolean b = dObj.isInfinite();
        System.out.println(b);
    }
}
 
/*
    
run:
    
true

*/

 



answered Nov 3, 2016 by avibootz

Related questions

1 answer 150 views
1 answer 175 views
1 answer 166 views
1 answer 198 views
1 answer 207 views
1 answer 211 views
1 answer 197 views
...