Java循环执行次数分析:while循环与异常处理
下面的循环一共会被执行____次。 int i=0; while(i<10) { try {throw new OverflowException();} catch (ArgumentException){i+=2;} catch (ArithmeticException) {i+=4;} catch (Exception) {i+=6;} finally {i--;} } A.10 B.5 C.4 D.2 循环会被执行10次。
原文地址: https://www.cveoy.top/t/topic/p8cK 著作权归作者所有。请勿转载和采集!