C# program to demonstrate the example of an array of delegates
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to demonstrate the array of delegates is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created a Sample class that contains four static methods Method1() and Method2(), Method3(), and Main().
Method1(), Method2(), Method3(), and Method4() are used to print a message on the console screen. In the Main() method we created the array of delegates and bind the methods with delegates.
In the above code, we invoked the methods using an array of delegates using an index.
need an explanation for this answer? contact us directly to get an explanation for this answer