Câu hỏi phỏng vấn C#
Câu hỏi

What is the difference between F...

Câu trả lời

The main differences between Func<string,string> and a custom delegate are:

Syntax

  • Func<string,string> is a built-in generic delegate in C# that represents a method with a string parameter and a string return type. It's defined as public delegate TResult Func<in T, out TResult>(T arg);
  • A custom delegate is defined using the delegate keyword, e.g. public delegate string StringTransformer(string input);

Flexibility

  • Func<string,string> is limited to methods with a string parameter and string return type.
  • A custom delegate can represent any method signature, e.g. taking multiple parameters of different types, returning void, etc.

Reusability

  • `Func<st...
senior

senior

Gợi ý câu hỏi phỏng vấn

expert

What are the benefits of a Deferred Execution in LINQ?

junior

What is an Abstract Class?

middle

What is the difference between Interface and Abstract Class?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào