zoukankan      html  css  js  c++  java
  • DoSomething

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Test {     public interface IMyInterface     {         void DoSomething();         void DoSomethingElse();     }     public class MyBaseClass : IMyInterface     {         #region IMyInterface 成员         public virtual void DoSomething()         {             Console.WriteLine("MyBaseClass中的DoSomething");         }         public virtual void DoSomethingElse()         {             Console.WriteLine("MyBaseClass中的DoSomethingElse");         }         #endregion     }     public class MyDerivedClass : MyBaseClass     {         public new void DoSomething()         {             Console.WriteLine("MyDerivedClass中的DoSomething");         }         public override void DoSomethingElse()         {             Console.WriteLine("MyDerivedClass中的DoSomethingElse");         }     }     class Program     {         static void Main(string[] args)         {             //---------------------------------------------------             MyDerivedClass d = new MyDerivedClass();             d.DoSomething();             Console.WriteLine(new String('-', 50));             //---------------------------------------------------             MyBaseClass mybase = new MyBaseClass();             mybase.DoSomething();             Console.WriteLine(new String('-', 50));             //---------------------------------------------------             IMyInterface im = d;             im.DoSomething();             Console.WriteLine(new String('-', 50));             //---------------------------------------------------             //im = mybase;             //im.
                Console.ReadKey();         }     } }
  • 相关阅读:
    “大型售票系统”和“真正的电商系统”在“库存”巨大的差异计算
    c#有关udp可靠传输(包传输数据包) 升级
    CreateCompatibleDC工作原理
    Android 内存管理 &Memory Leak & OOM 分析
    ubuntu文本界面乱码的中国解决方案
    hdu 4972 A simple dynamic programming problem(高效)
    java定义和实现接口
    HTTP 404
    pcre函数具体解释
    Android项目开发五-《星星生活志》1.使用MediaRecorder录制音频
  • 原文地址:https://www.cnblogs.com/icedlemon/p/4300577.html
Copyright © 2011-2022 走看看