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 / claivan
Finally block will not return any values as it gives
error "Control cannot leave the body of a finally clause".
The finally block is useful for cleaning up any resources
allocated in the try block.
| Is This Answer Correct ? | 13 Yes | 0 No |
Post New Answer View All Answers
Why is c# good for games?
What are the differences between system.string and system.text.stringbuilder classes?
What is a shared assembly?
What is the use of console?
What is difference between property and variable in c#?
If I return out of a try/finally in c#, does the code in the finally-clause run?
Can constructor have return type c#?
What is the example of predicate?
What is mean by c#?
Does main have to be static c#?
what are some characteristics of an array?
Are tuples mutable c#?
How we can create an array with non-default values?
What is method in c#?
Is string value type c#?