# 5.9) Does the order of the exceptions caught in the catch blocks matter?

![](https://2172743581-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La4k4liN--SZ6ay4iod%2F-La_KI-y1nsJivNG32KG%2F-La_KZVf88AzsvZ586Da%2Fimage.png?alt=media\&token=f2d79192-70d3-4414-ac94-e9fa79ed0065)

![](https://2172743581-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La4k4liN--SZ6ay4iod%2F-La_KI-y1nsJivNG32KG%2F-La_KfzlH3nr-ywsRkM2%2Fimage.png?alt=media\&token=88893136-851b-48e8-8d0f-c0866f6a1b35)

```java
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class CaseBaseExceptionBeforeDerived {
	public static void main(String[] args) {
		FileInputStream fis = null;
		try {
			fis = new FileInputStream("file.txt");
			fis.close();
		} catch (IOException ioe) {
			System.out.println("IOException");
		} catch (FileNotFoundException fnfe) {
			System.out.println("File not found");
		}
	}
}
```

![](https://2172743581-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La4k4liN--SZ6ay4iod%2F-La_KI-y1nsJivNG32KG%2F-La_KRpIlKXMBZOHk5eE%2Fimage.png?alt=media\&token=15860956-cfc9-462c-9fb9-c0d2aa4e6b4b)



![](https://2172743581-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La4k4liN--SZ6ay4iod%2F-La_KI-y1nsJivNG32KG%2F-La_KpaIUfF5IZ6rw53Q%2Fimage.png?alt=media\&token=b537b9fd-6ca7-4eb4-970c-c65b45ff0809)

![](https://2172743581-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La4k4liN--SZ6ay4iod%2F-La_KI-y1nsJivNG32KG%2F-La_KyBkNpJSnk1RqD1O%2Fimage.png?alt=media\&token=043b8b35-ba05-4694-ab1f-1be0c81daf0f)

![](https://2172743581-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La4k4liN--SZ6ay4iod%2F-La_KI-y1nsJivNG32KG%2F-La_LFJAaNEuLCMzcvV6%2Fimage.png?alt=media\&token=7838b64a-8354-4ceb-8524-2b1a5cbcc5d9)
