Created
August 4, 2015 14:58
-
-
Save yanisurbis/50f0a2f5dd3dc36dfcc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
B b = new C(); | |
b.hi(); | |
Console.ReadLine(); | |
} | |
} | |
class A | |
{ | |
virtual public void hi() | |
{ Console.WriteLine("hiA"); } | |
} | |
abstract class B : A | |
{ | |
override public abstract void hi(); | |
} | |
class C : B | |
{ | |
override public void hi() | |
{ Console.WriteLine("hiC"); } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment