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();         }     } }
  • 相关阅读:
    测试阅读量
    JS中的 length, var i = [1,2]; i[length], 与 i.length, i["length"]的区别
    微信小程序:button组件的边框
    mongo学习笔记
    C言语语法总结(随时更新)
    Vim 常用命令总结
    php 文件操作
    git常用命令
    递归方式转迭代方式
    ECMAScript6 ES6 ES2015新语法总结
  • 原文地址:https://www.cnblogs.com/icedlemon/p/4300577.html
Copyright © 2011-2022 走看看