- 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.
推薦閱讀
- MySQL數據庫管理實戰
- .NET 4.0面向對象編程漫談:基礎篇
- TestNG Beginner's Guide
- 深入理解Java7:核心技術與最佳實踐
- Learning R for Geospatial Analysis
- 代替VBA!用Python輕松實現Excel編程
- 從程序員角度學習數據庫技術(藍橋杯軟件大賽培訓教材-Java方向)
- RESTful Web Clients:基于超媒體的可復用客戶端
- Windows Phone 8 Game Development
- 零基礎看圖學ScratchJr:少兒趣味編程(全彩大字版)
- Software-Defined Networking with OpenFlow(Second Edition)
- PHP項目開發全程實錄(第4版)
- Building UIs with Wijmo
- Head First Kotlin程序設計
- PHP程序設計經典300例