If I have code like
try
{
return;
}
catch
{
return;
}
finally
{
return;
}

from which block will the value will be returned. and try
has been executed without any error.

Answer Posted / vijay k chin

the above block will not execute as control will be unable to enter in to the filnally block. So return statement should be always in finally block not in the try block.

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a nullreferenceexception?

732


What is connection pooling in ado.net?

708


In which order the destructor is called for an inherited class?

708


What language do desktop applications use?

672


Can we override main method in c#?

691


What is difference between managed and unmanaged code?

687


Explain different properties of object oriented systems.

681


What is the importance of closing an ado.net application?

665


What is default value of bool in c#?

698


Explain the process of polymorphism with an example?

659


Explain the access modifiers in c#?

671


What is a variable in c#?

678


What is interface inheritance?

706


What is difference between list and ilist in c#?

622


While debugging a C# application can you change the value of a variable?

738