MCPcopy Index your code
hub / github.com/DuGuQiuBai/Java / ThrowsDemo

Class ThrowsDemo

day19/code/day19_Exception/src/cn/itcast_05/ThrowsDemo.java:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 * throws:���ڷ����ϣ��׳��쳣���õ�����ȥ������
9 */
10public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected