> For the complete documentation index, see [llms.txt](https://gyansetu-core-java-for-java.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gyansetu-core-java-for-java.gitbook.io/project/exception-handling/4-what-happens-when-an-exception-is-thrown/what-happens-if-both-a-catch-and-a-finally-block-define-return-statement.md).

# 5.6) What happens if both a catch and a finally block define return statement?

![](/files/-La_2HmvXwZkloS8s9Ay)

![](/files/-La_2MWfKum8a0kceY_S)

```java
public class MultipleReturn {
	int getInt() {
		try {
			String[] students = { "Harry", "Paul" };
			System.out.println(students[5]);
		} catch (Exception e) {
			return 10;
		} finally {
			return 20;
		}
	}
}
```

```java
public class TestMultipleReturn {
	public static void main(String[] args) {
		MultipleReturn var = new MultipleReturn();
		System.out.println(var.getInt());
	}
}
```
