读书人

Java编程思维学习笔记(二)

发布时间: 2012-09-20 09:36:51 作者: rapoo

Java编程思想学习笔记(二)

Java编程思想学习笔记(二)

?

?

?

public class InheritingExceptions { public void f() throws SimpleException { System.out.println("异常"); throw new SimpleException(); } public static void main(String[] args) { InheritingExceptions sed = new InheritingExceptions(); try { sed.f(); } catch (SimpleException e) { System.out.println("Caught it"); } }}class SimpleException extends Exception {}

?

?

???

读书人网 >编程

热点推荐