您为什么不能自己检查一下并抛出异常(如果您要的话)。
try { for (int i = 0; i < tab.length; i++) { tab[i] = 1.0 / tab[i]; if (tab[i] == Double.POSITIVE_INFINITY || tab[i] == Double.NEGATIVE_INFINITY) throw new ArithmeticException(); } } catch (ArithmeticException ae) { System.out.println("ArithmeticException occured!"); }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)