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

What is Multicas...

Câu trả lời

A Multicast Delegate in C# is a delegate that can hold references to multiple handler functions[1][2][3]. When the multicast delegate is invoked, it calls all the referenced methods in the order they were added to the delegate[1][4][5].

To create a multicast delegate, you first create two regular unicast delegates (delegates that reference a single method) and combine them using the + operator[4]. This internally calls Delegate.Combine with the two delegates as arguments and returns a new multicast delegate instance[4].

The behavior of a multicast delegate when invoked is as follows:

  • The methods that the delegate object points to are invoked in sequence in the order they were added to the delegate[4]
  • The return value of the delegate is the return value of the last method invoked - all the others are discarded[4]

Some key points about multicast delegates:

  • All method signatures referenced...
expert

expert

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

junior

What are Reference Types in C#?

senior

Can you explain the difference between Interface , abstract class, sealed class, static class and
partial class in C#?

middle

What is the use of the IDisposable interface?

Bình luận

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

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