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
Is namespace necessary in c#?
How do I create a multi language, multi file assembly?
When Should You Call The Garbage Collector In .net?
Can you inherit from a sealed class?
What is different about switch statements in c#?
What is interface c#?
Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?
What is difference between c sharp and c#?
What is main thread in c#?
Does main have to be static c#?
What is difference between const and static in c#?
What is tuple in c#?
What is an indexer in c#?
Define satellite Assembly in .NET?
Contrast between an interface and abstract class?