資源簡介
委托功能實例
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
namespace?chapter0605
{
????class?Program
????{
????????delegate?double?processDelegate(double?param1?double?param2);//委托
????????static?double?Multiply(double?parma1?double?parma2)
????????{
????????????return?parma1?*?parma2;
????????}
????????static?double?Divde(double?parma1?double?parma2)
????????{
????????????return?parma1?/?parma2;
????????}
????????static?void?Main(string[]?args)
????????{
????????????processDelegate?process;
????????????Console.WriteLine(“enter?2?numbers?separated?with?a?comma:“);
????????????string?input?=?Console.ReadLine();
????????????int?commaPos?=?input.IndexOf(‘‘);
????????
- 上一篇:C#.NET 109道面試題(含答案)
- 下一篇:C#程序的157個建議(附源代碼)
評論
共有 條評論