

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Action Delegate in C#
Action delegate does not return a value and can be used with a method that has a void return type.
Declare Action Delegate.
Action<int> del = Display;
Here is our method −
public static void Display(int val) { Console.WriteLine(val); }
Now call the method with a value.
Example
using System; public class Demo { public static void Main() { Action<int> del = Display; del(2); } public static void Display(int val) { Console.WriteLine(val); } }
Output
2
- Related Questions & Answers
- What is the difference between Func delegate and Action delegate in C#?
- How to declare a delegate in C#?
- How to enable back button action in action bar?
- Python - Button Action in Kivy
- Set up a simple delegate to communicate between two view controllers in iPhone
- How to sort a list of complex types using Comparison delegate in C#?
- HTML Form action Attribute
- Action of Commutator in DC Generator
- HTML DOM Form action Property
- How to hide action bar in android?
- How to add action icon in android?
- Enable successful action of Bootstrap button
- Primary action in a set of Bootstrap buttons
- How to disable action bar tittle in android?
- How to enable back button in action bar?
Advertisements