| 8 | * throws:���ڷ����ϣ��׳��쳣���õ�����ȥ������ |
| 9 | */ |
| 10 | public class ThrowsDemo { |
| 11 | public static void main(String[] args) { |
| 12 | // show(); |
| 13 | try { |
| 14 | show2(); |
| 15 | } catch (ParseException e) { |
| 16 | e.printStackTrace(); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | public static void show() throws ArithmeticException { |
| 21 | int a = 10; |
| 22 | int b = 0; |
| 23 | System.out.println(a / b); |
| 24 | } |
| 25 | |
| 26 | public static void show2() throws ParseException { |
| 27 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 28 | Date d = sdf.parse("2012-03-04"); |
| 29 | System.out.println(d); |
| 30 | } |
| 31 | } |
nothing calls this directly
no outgoing calls
no test coverage detected