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

junior

What is namespace in C#?

middle

What is Virtual Method in C#?

expert

What is the use of static constructors?

Bình luận

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

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