- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExTestDrive.java
More file actions
Latest commit
36 lines (32 loc) · 494 Bytes
/
Copy pathExTestDrive.java
File metadata and controls
36 lines (32 loc) · 494 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
classMyExextendsException {}
publicclassExTestDrive
{
publicstaticvoidmain(String[] args)
{
Stringtest = args[0];
System.out.print("t");
try
{
doRisky(test);
System.out.print("r");
System.out.print("o");
}
catch (MyExe)
{
System.out.print("a");
}
finally
{
System.out.print("w");
System.out.println("s");
}
}
staticvoiddoRisky(Stringt) throwsMyEx
{
System.out.print("h");
if ("yes".equals(t))
{
thrownewMyEx();
}
}
}