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();         }     } }
  • 相关阅读:
    Asp.net Mvc中MVCContrib中无法使用Castle的发解决方案
    Asp.net Mvc Framework 十(测试方法及Filter的示例)
    无注册表的COM调用
    Direct3D 9学习笔记(13)网格(Mesh)4
    Direct3D 9学习笔记(11)网格(Mesh)2
    ATL 核心COM继承类之IDispatchImpl及调用
    ATL 核心COM继承类之CComObjectRootEx及CComObjectLock
    Direct3D 9学习笔记(12)网格(Mesh)3
    ATL COM类之激活
    ATL 引用计数线程模型
  • 原文地址:https://www.cnblogs.com/icedlemon/p/4300577.html
Copyright © 2011-2022 走看看