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

Explain how do you convert a value-type to a reference-type?

534


What is an xsd file?

586


What is the difference between select and selectmany?

517


Differentiate between dataset and datareader?

617


What is strong name in c# and how can we use it?

619






How to get the sum of last 3 items in a list using lambda expressions?

595


What is namespace give the example?

547


What is managed or unmanaged code?

664


What is the relation between classes and objects?

603


Explain synchronous and asynchronous operations?

621


Why singleton class is sealed in c#?

591


What are assemblies?

610


What are sessions in c#?

586


What is the .net datatype that allows the retrieval of data by a unique key?

535


What is console write in c#?

575