---
title: "Explain the use of delegate, Action, Func, and Predicate."  
description: "Explain the use of delegate, Action, Func, and Predicate."  
author: "ICSM Computer"  
published: 2025-06-19  
updated: 2025-06-19  
canonical: https://www.mindstick.com/interview/34262/explain-the-use-of-delegate-action-func-and-predicate  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Explain the use of delegate, Action, Func, and Predicate.

#### Explain the use of `delegate`, `Action`, `Func`, and `Predicate`.

- **Delegate**: A type that references a method.
- **Action**: Built-in delegate that returns `void`.
- **Func<T>**: Returns a value of type `T`.
- **Predicate<T>**: Returns a boolean and takes one parameter.

## Example:

```cs
Action<string> greet = name => Console.WriteLine("Hello " + name);
Func<int, int, int> add = (a, b) => a + b;
Predicate<int> isEven = x => x % 2 == 0;
```

## Answers

### Answer by ICSM Computer

#### Explain the use of `delegate`, `Action`, `Func`, and `Predicate`.

- **Delegate**: A type that references a method.
- **Action**: Built-in delegate that returns `void`.
- **Func<T>**: Returns a value of type `T`.
- **Predicate<T>**: Returns a boolean and takes one parameter.

## Example:

```cs
Action<string> greet = name => Console.WriteLine("Hello " + name);
Func<int, int, int> add = (a, b) => a + b;
Predicate<int> isEven = x => x % 2 == 0;
```


---

Original Source: https://www.mindstick.com/interview/34262/explain-the-use-of-delegate-action-func-and-predicate

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
