CourseLoops

CourseLoops

Share

06/27/2020

♻️TIPS: Will a finally block execute even if the catch block defines a return statement?

✅ Imagine this scenario: A guy promises to buy diamonds for his girlfriend and treat her to coffee. The girl inquires about what will happen if he meets with an exceptional condition during the diamond purchase, such as inadequate funds. To the girl’s disappointment, the boy replies that he’ll still treat her to coffee.
You can compare the try block to the purchase of diamonds and the finally block to the coffee treat. The girl gets the coffee treat regardless of whether the boy successfully purchases the diamonds. The figure shows this conversation.

Want your school to be the top-listed School/college in Hamilton?
Click here to claim your Sponsored Listing.

Website

Address


Hamilton, ON