C#英语笔记Day 40

1.词汇

  • delegate type 委托类型
  • delegate instance 委托实例
  • interface 接口

2.例句

  • I’m sure you already have an instinctive idea about what a delegate is, even though it can be hard to articulate. Essentially,delegates provide a level of indirection: instead of specifying behavior to be executed immediately, the behavior can somehow be “contained” in an object. That object can then be used like any other, and one operation you can perform with it is to execute the encapsulated action. Alternatively, you can think of a delegate type as a singlemethod interface, and a delegate instance as an object implementing that interface.

    可以肯定,你对委托delegate有了直观的认识,即使此时你无法清晰的描述出来。实际上,委托在某种程度上提供了间接的方法:不需要直接指定一个要立即执行的行为,而是将这个行为包裹在对象里,这个对象可以像其他对象那样使用,在该对象中可以执行封装的操作。换言之,可以将委托类型当做只定义了一个方法的接口,而委托实例当做是实现了该接口的一个对象

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容