Delegates vs Interfaces in C#

后端 未结 5 634
遇见更好的自我
遇见更好的自我 2021-01-30 00:37

I would like to pose this question as long as I am trying currently to dig into the use and the purpose of delegates, although it is likely to have been asked in similar formula

5条回答
  •  情歌与酒
    2021-01-30 01:23

    Delegates and Interfaces are two distinct concepts in C#.

    Interfaces allow to extend some object's functionality, it's a contract between the interface and the object that implements it, while delegates are just safe callbacks, they are a sort of function pointers.

提交回复
热议问题