Why can't I put a delegate in an interface?

前端 未结 7 1032
清歌不尽
清歌不尽 2021-02-01 03:24

Why can\'t I add a delegate to my interface?

7条回答
  •  难免孤独
    2021-02-01 04:28

    A Delegate is a type which can't be declared in an interface. You might want to either use an event(if appropriate) or declare a delegate outside the interface but in the same namespace.

    This link may help- When to Use Delegates Instead of Interfaces

提交回复
热议问题