- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 94字
- 2021-07-02 15:29:23
Adding delegates
In the first stage, you have to add delegates. While you could put these into a separate file, for our purposes let's just place them here. So, enter the following above the line beginning with public partial class...:
public delegate bool Compare(double x, double y);
Remember, delegates are function or method wrappers, actually. Then, directly below this line, enter the following:
public delegate double Multiply(double x, double y);
You can see here that we have two delegates. One returns a Boolean data type, and the other one returns a double data type.
推薦閱讀
- Java EE 6 企業級應用開發教程
- ASP.NET MVC4框架揭秘
- C#程序設計(慕課版)
- AngularJS深度剖析與最佳實踐
- Visual FoxPro程序設計
- Hands-On Kubernetes on Windows
- HTML5+CSS3+jQuery Mobile APP與移動網站設計從入門到精通
- 從0到1:HTML5 Canvas動畫開發
- HTML5+CSS3+JavaScript 從入門到項目實踐(超值版)
- 深度學習程序設計實戰
- Python預測分析實戰
- 從零開始學Python大數據與量化交易
- Java程序設計實用教程(第2版)
- JavaScript前端開發基礎教程
- Java Web開發基礎與案例教程