首页 > 其他 > 详细

多态,接口

时间:2015-12-14 10:32:59      阅读:111      评论:0      收藏:0      [点我收藏+]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Factory
{
public class person
{
int yanjing;
int erduo;
int bizi;
int foot;
int shou;
string sex;

void Speak()
{
//
}

void Eat()
{
//
}

public void printSex()
{
//
}
}

public interface Career
{
void positon();
}

public class Chief : person, Career
{
public void positon()
{
Console.WriteLine("我是习大大主席");
}
}
public class Secretary : person, Career
{
public void positon()
{
Console.WriteLine("我的职位是秘书");
}

}

class Program5
{
//static void Main()
//{
// Career chief = new Chief();
// chief.positon();
// Console.WriteLine();
// Career secretary = new Secretary();
// secretary.positon();
// Console.ReadLine();
//}
}

 

}

多态,接口

原文:http://www.cnblogs.com/pcc5201314/p/5044208.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!