提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
检查参数原始双精度值是否为无穷大
public class Main { public static void main(String[] args) { /** from * nowjava **/ double d = (double) 4/0; boolean b1 = Double.isInfinite(d); System.out.println(b1); Double dObj = new Double(d); boolean b2 = dObj.isInfinite(); System.out.println(b2); } }