What is a delegate in C#?
Correct answer D. A type-safe reference to a method with a specific signature
Topic / 95 questions
Page 3 of C# multiple-choice questions with answers. Tap an option to check yourself.
Page 3 of 5
Correct answer D. A type-safe reference to a method with a specific signature
Correct answer A. Its Dispose method is called when the block is exited, even if an exception is thrown
Correct answer C. A method declared inside another method and visible only within it
Correct answer B. Once, automatically, before the first instance is created or any static member is accessed
Correct answer B. Creates a copy of p1 with Y changed to 5, leaving p1 unchanged
Correct answer A. True
Correct answer D. 1
Correct answer A. A class is a reference type, while a struct is a value type copied on assignment
Correct answer A. It must be a static method in a non-generic static class, with this before the first parameter
Correct answer C. -1
Correct answer A. null
Correct answer A. 2
Correct answer B. -2147483648
Correct answer B. An OverflowException is thrown
Correct answer A. 0
Correct answer A. three
Correct answer D. Control cannot fall through from one non-empty case section to the next
Correct answer B. A relational pattern
Correct answer B. That s is not null and its Length property is greater than 3
Correct answer C. An InvalidOperationException is thrown when the loop continues