using System;
using System.Collections.Generic;
using System.Text;
namespace Super
{
class Program
{
static void Main(string[] args)
{
SuperMan sm = new SuperMan();
sm.NightWork();
((IMoster)sm).Create();
sm.DayWord();
((IPerson)sm).Create();
}
}
//妖的接口
interface IMoster
{
void NightWork();//晚上工作的方法
void Create();//晚上生育的方法
}
//人的接口
interface IPerson
{
void DayWord();//白天工作的方法
void Create();//白天生育的方法
}
//超人 实现妖和人 两接口
class SuperMan : IMoster, IPerson
{
#region IMoster 成员
public void NightWork()
{
Console.WriteLine("晚上工作");
}
void IMoster.Create()
{
Console.WriteLine("晚上生妖");
}
#endregion
#region IPerson 成员
public void DayWord()
{
Console.WriteLine("白天工作");
}
void IPerson.Create()
{
Console.WriteLine("白天生人");
}
#endregion
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有