Why do we need C# delegates

前端 未结 8 674
遥遥无期
遥遥无期 2020-12-22 19:47

I never seem to understand why we need delegates? I know they are immutable reference types that hold reference of a method but why can\'t we just call the method directly,

8条回答
  •  臣服心动
    2020-12-22 20:42

    1. Delegates supports Events
    2. Delegates give your program a way to execute methods without having to know precisely what those methods are at compile time

提交回复
热议问题