MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

exceptions/MessyExceptions.java:8–26  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

6
7public class MessyExceptions {
8 public static void main(String[] args) {
9 InputStream in = null;
10 try {
11 in = new FileInputStream(
12 new File("MessyExceptions.java"));
13 int contents = in.read();
14 // Process contents
15 } catch(IOException e) {
16 // Handle the error
17 } finally {
18 if(in != null) {
19 try {
20 in.close();
21 } catch(IOException e) {
22 // Handle the close() error
23 }
24 }
25 }
26 }
27}

Callers

nothing calls this directly

Calls 2

readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected