If we write return statement in finally block will it works
fine or throws any error?
Answer Posted / mahesh kotekar
Answer Is NO. We cannot have return in finally block...
we get the following error.
Control cannot leave the body of a finally clause
returns void, a return keyword must not be followed by an
object expression
try
{
First.DoSomething1();
First.DoSomething2();
}
catch (Exception)
{
throw;
}
finally
{ return 0; }
Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
What is the 'page life cycle' of an ASP.NET MVC?
What is entitytype? : Entity framework
Do I need microsoft .net framework?
What is the difference between renderaction and renderpartial?
What is entity framework? : Entity framework
Can you Write the GC(Garbage Collector) Algoritham in .NET? (But not Explination of Working of GC).
What is the use of view model in asp.net mvc?
I want ask from plz smaple example code for Biztalkk server
What is poco proxy? : Entity framework
how do you query in entity model when the result has a join from from different database other than the entity model?
How to update one of my table in database at 4pm every day how it is possible?
What is the need of Action Filters in ASP.Net MVC
Which are the important namespaces used in mvc?
Which .net framework is installed?
How we can register the Area in ASP.Net MVC?