Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Dog{
- string name;
- }
- public class Duck{
- string name;
- }
- public class Cow{
- string name;
- }
- public static void Main(string[] args)
- {
- List<Animal> animals = new List<Animal>(){
- new Dog("Dogy"),
- new Duck("Ducky"),
- new Cow("Cowy")
- }
- foreach(Animal a on animals)
- {
- MakeSound(a, rule);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement