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 use of viewmodel in mvc?
Briefly describe the roles of clr in .net framework?
Is it possible to combine asp.net webforms and asp.mvc and develop a single web application?
What is route config?
What is the difference between windows vista and .net framework 3.0 ?
What is the difference between entity framework and mvc?
Explain Bundle.Config in ASP.Net MVC4?
Explain the request flow in asp.net mvc framework?
What is action methods in web api?
Define the core components of an ASP.NET MVC application?
Explain the advantages of dependency injection (di) in asp.net mvc?
What is the use .Glimpse in ASP.Net MVC
Does razor engine supports for tdd?
What is page life cycle?
what do you mean by table-per-type?