Solved

Finally clause

Posted on 2006-06-14
4
173 Views
Last Modified: 2010-04-16
If there's a return statement outside try/catch/finally block, is finally still executed?

Thanks
0
Comment
Question by:gromul
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Expert1701
ID: 16906956
Yes, in the case of,

  try
  {
    return;
  }
  finally
  {
  }

or,

  try
  {
  }
  finally
  {
  }

  return;

the finally block will be executed.
0
 

Author Comment

by:gromul
ID: 16907964
What about this?

return;

try
  {
  }
  finally
  {
  }

 
0
 
LVL 11

Accepted Solution

by:
Expert1701 earned 500 total points
ID: 16908106
In that case, no.  Neither the try, nor the finally blocks will execute.
0
 

Author Comment

by:gromul
ID: 16908150
Thanks
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now