Could you explain the difference between func vs action vs predicate?



Could you explain the difference between func vs action vs predicate?..

Answer / Subhash Kumar

In C#, `Func<T>` represents a function that returns a specific type, while `Action<T>` is a delegate that takes in a single argument but doesn't return any value. On the other hand, `Predicate<T>` is a delegate that takes in an object and returns a Boolean result indicating whether a condition has been met.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

How do I do implement a trace and assert?

1 Answers  


What are value types and reference types?

1 Answers  


What is difference between managed and unmanaged code?

1 Answers   SwanSoft Technologies,


how to communicate inventory system and account system?

1 Answers  


Is null empty or whitespace c#?

1 Answers  


What is the use of console readline () in c#?

1 Answers  


What is the difference between ref and out in c#?

1 Answers  


What?s the difference between the Debug class and Trace class?

2 Answers  


Why do we need ienumerable in c#?

1 Answers  


What is CASPOL?

1 Answers   MCN Solutions,


Where is the output of TextWriterTraceListener redirected?

1 Answers   Rolta, Siebel Systems,


In c# how to connect crystal report?

2 Answers  


Categories