When does a finally block execute in C#?
Correct answer B. After the try block and any catch, whether or not an exception occurred, even after return
Subject / 929 questions
Page 23 of Programming multiple-choice questions with answers. Tap an option to check yourself.
Page 23 of 47
Correct answer B. After the try block and any catch, whether or not an exception occurred, even after return
Correct answer B. throw; keeps the original stack trace, while throw ex; resets it to the current point
Correct answer A. Its Dispose method is called when the block is exited, even if an exception is thrown
Correct answer B. To give callers a Dispose method that releases unmanaged or expensive resources deterministically
Correct answer D. A type-safe reference to a method with a specific signature
Correct answer B. The return type
Correct answer B. Action<string>
Correct answer D. bool
Correct answer D. 333
Correct answer C. The return value of the last method in the invocation list
Correct answer C. Outside code can only subscribe with += and unsubscribe with -=, not invoke or replace it
Correct answer C. where T : new()
Correct answer B. null for reference types and the zero value for value types
Correct answer A. Because IEnumerable<out T> is covariant in T
Correct answer D. A KeyNotFoundException is thrown
Correct answer C. -1
Correct answer A. null
Correct answer A. 2
Correct answer B. -2147483648
Correct answer B. An OverflowException is thrown