Why do we need C# delegates

前端 未结 8 714
伪装坚强ぢ
伪装坚强ぢ 2020-12-22 20:06

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:41

    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

提交回复
热议问题