Created
September 9, 2019 20:11
-
-
Save KvanTTT/e3d75635d67620e5769a96376b597516 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
class Program | |
{ | |
class Animal | |
{ | |
} | |
class Cat : Animal | |
{ | |
public void Meow() | |
{ | |
} | |
} | |
class Dog : Animal | |
{ | |
public void Woof() | |
{ | |
} | |
} | |
static void Main(string[] args) | |
{ | |
var cats = new Cat[] {new Cat(), new Cat()}; | |
Animal[] animals = cats; | |
animals[1] = new Dog(); | |
cats[1].Meow(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment