Home / MCQ Bank / Computer
Computer Delegates And Events In C Sharp

What is the purpose of the Action delegate in C#?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • Represents a delegate that can encapsulate a method with a single parameter and does not return a value

Related Computer Questions

What will be the output of the following C# code? enum colors { red, black, pink } colors s = colors.black; type t; t = c.GetType(); string[] str; str = Enum.GetNames(t); Console.WriteLine(str[0]); Choose the correct option to fill? X so that the code given below implements the Heap sort. #include <stdio.h> void heapify(int arr[], int n, int i) { int largest = i; // Initialize largest as root int l = 2*i + 1; // left = 2*i + 1 int r = 2*i + 2; // right = 2*i + 2 if (l < n && arr[l] > arr[largest]) largest = l; if (r < n && arr[r] > arr[largest]) largest = r; if (largest != i) { swap(arr[i], arr[largest]); heapify(arr, n, largest); } } void heapSort(int arr[], int n) { for (int i = n / 2 - 1; i >= 0; i--) heapify(arr, n, i); for (int i=n-1; i>=0; i--) { X; heapify(arr, i, 0); } } void printArray(int arr[], int n) { for (int i=0; i<n; ++i) printf(“%d”,arr[i]); printf(“\n”); } int main() { int arr[] = {12, 11, 13, 5, 6, 7}; int n = sizeof(arr)/sizeof(arr[0]); heapSort(arr, n); printf(“Sorted array is \n"); printArray(arr, n); } What would happen if the data in the client had been wrong? A number of letters that appear a little above the normal text is called? In the following Python code, which function is the decorator? def mk(x): def mk1(): print("Decorated") x() return mk1 def mk2(): print("Ordinary") p = mk(mk2) p()