正在加载图片...
Java实例 异常 public class Exception2{ public static void main(String args[]){ try( int x,yi x=15: y=0: System.out.println(x/y); System.out.println("Computing successfully!"); } catch (ArithmeticException e){ System.out.println("ArithmeticException catched !") System.out.println("Exception message:"+e.tostring()); finally{ System.out.println("Finally block.");Java实例——异常 public class Exception2{ public static void main(String args[]){ try{ int x, y; x=15; y=0; System.out.println(x/y); System.out.println("Computing successfully!"); } catch (ArithmeticException e){ System.out.println(" ArithmeticException catched !" ); System.out.println("Exception message:"+e.toString()); } finally{ System.out.println("Finally block."); } }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有