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
What is the diff between System.String and System.Text.StringBuilder classes?
Why can’t struct be used instead of class for storing entity?
Why we use get set in c#?
What are handlers in c#?
What is the signature of a method?
Can I define a type that is an alias of another type (like typedef in c++)?
What is the difference between “finalize” and “finally” methods in c#?
What you mean by delegate in c#?
Which is more efficient for loop or while loop?
What is a void c#?
What are the advantages of using delegates in c#?
What is getenumerator?
Explain the difference between // comments, /* */ comments and /// comments?
What is the difference between Static, Const and read only?
What is namespace in oops?