> For the complete documentation index, see [llms.txt](https://bernardo.gitbook.io/development-docs-java/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bernardo.gitbook.io/development-docs-java/errors-and-exceptions/checked-exceptions.md).

# Checked Exceptions

They should be caught:

```java
try
{
   // This can cause an exception
   in = new FileInputStream(file);
} catch (final IOException e)
{
   // Exception handling
   e.printStackTrace();
} finally
{
   // Always applied
   file.delete();
}
```

Or declared:

```java
public handleFile(final File file) throws IOException;
```
