// 继承 多态 virtual 虚方法 override 重写
// 抽向类(抽象方法) 接口 消息Message SMS Email ...
abstract class Message
{
public string sender;
public string receiver;
public string content;
public DateTime sendtime;
//public virtual void Send(){}
public abstract void Send();//抽象方法
}
class QQMsg:Message
{
public override void Send()
{
}
}
class SMS : Message
{
public override void Send()
{//手机 3G ...
}
}
class Email : Message
{
public override void Send()
{
//smtp pop ... 服务器
}
}
// 抽向类(抽象方法) 接口 消息Message SMS Email ...
abstract class Message
{
public string sender;
public string receiver;
public string content;
public DateTime sendtime;
//public virtual void Send(){}
public abstract void Send();//抽象方法
}
class QQMsg:Message
{
public override void Send()
{
}
}
class SMS : Message
{
public override void Send()
{//手机 3G ...
}
}
class Email : Message
{
public override void Send()
{
//smtp pop ... 服务器
}
}