当前位置:开发者网络 >> 技术教程 >> .NET教程 >> C#语言 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
今天又是考试时间了,大家来考试了,第一题,答对有奖呀
作者:未知
日期:2003-07-12
人气:
投稿:Andy.m(转贴)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:
1.以下程序中有没有错误?如果有,请说明错误发生的前提以及现象:)
public class FlyBird
{
     private static FlyBird bird;
     public static FlyBird getBird()
     {
           if(bird==null)
                   bird=new FlyBird();
            return bird;
     }
     public event FlyEventHandler OnFly;
     public void OnFlyEvent(string m)
     {
              this.OnFly(this,new FlyEventArgs(m));
     }
     public void StartFly()
     {
        this.OnFlyEvent("正在起飞...");  
          ....
     }
     public void PauseFly()
     {
          this.OnFlyEvent("暂停飞行...");
          ...
      }
     public void Cookie()
     {
           this.OnFlyEvent("回家做饭:)。。。"):
           ....
      }
      public void InLove()
      {
           this.OnFlyEvent("恋爱中...");
       }
      
     public FlyBird()
     {
             
     }
     public delegate void FlyEventHandler(object,FlyEventArgs);
}
public class FlyEventArgs:EventArgs
{
     private string status;
     public string Status
      {
              get
               {
                      return status;
                 }
       }
      public FlyEventArgs(string m):base()
       {
                 this.status=m;
         }

}
相关文章: