---
title: "If I write return at the end of the try block, will the finally block still execute?"  
description: "If I write return at the end of the try block, will the finally block still execute?"  
author: "Sumit Kesarwani"  
published: 2014-08-26  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/2014/if-i-write-return-at-the-end-of-the-try-block-will-the-finally-block-still-execute  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# If I write return at the end of the try block, will the finally block still execute?

Yes even if you write return as the last statement in the try block and no exception occurs, the finally block will execute. The finally block will execute and then the control return.

## Answers

### Answer by Sumit Kesarwani

Yes even if you write return as the last statement in the try block and no exception occurs, the finally block will execute. The finally block will execute and then the control return.


---

Original Source: https://www.mindstick.com/interview/2014/if-i-write-return-at-the-end-of-the-try-block-will-the-finally-block-still-execute

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
