最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一个有趣的例子:)关于delegate
时间:2022-07-02 18:08:48 编辑:袖梨 来源:一聚教程网
namespace DelegatesCS
{
using System;
public class Wisdom //包含代理的类
{
public delegate string GiveAdvice();
public string OfferAdvice(GiveAdvice s)
{
return Words();
}
}
public class Parent //基类
{
public virtual string Advice()
{
return("Listen to reason");
}
~Parent() {}
}
public class Dad: Parent //子类
{
public Dad() {}
public override string Advice()
{
return("Listen to your Mom");
}
~Dad() {}
}
public class Mom: Parent //子类
{
public Mom() {}
public override string Advice()
{
return("Listen to your Dad");
{
using System;
public class Wisdom //包含代理的类
{
public delegate string GiveAdvice();
public string OfferAdvice(GiveAdvice s)
{
return Words();
}
}
public class Parent //基类
{
public virtual string Advice()
{
return("Listen to reason");
}
~Parent() {}
}
public class Dad: Parent //子类
{
public Dad() {}
public override string Advice()
{
return("Listen to your Mom");
}
~Dad() {}
}
public class Mom: Parent //子类
{
public Mom() {}
public override string Advice()
{
return("Listen to your Dad");
相关文章
- 迅捷 FWR310 无线路由器端口映射设置指南 08-11
- 迅捷 FW150R 无线路由器端口映射设置指南 08-11
- 迅捷 FWD105 无线路由器一体机WDS桥接设置 08-11
- 迅捷 FW325R 无线路由器IP与MAC地址绑定设置 08-11
- 方舟生存进化琥珀获取指南 08-11
- 迅捷 FW150R 无线路由器作为交换机设置 08-11