No entiendo la diferencia entre el ejemplo de funciones virtuales y el de polimorfismo anterior. 😕 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

No entiendo la diferencia entre el ejemplo de funciones virtuales y el de polimorfismo anterior. 😕

27th Apr 2018, 4:34 AM
Sebastián J. Tosco
2 Answers
0
Polymorphism: interface IAnimal { virtual void MakeSound(); int Age{ set;get; } } class Dog : IAnimal { // public override MakeSound() { cw("woof"); } } public static void Main(string[] Argus) { // polymorphism IAnimal dog = new Dog() dog.MakeSound(); dog.Age = 3; } mi español es malo, dime si leo tu pregunta incorrectamente
4th May 2018, 12:42 AM
John
John - avatar
0
Gracias. 👍 I'll read your code and i'll comment about this. 😁
4th May 2018, 11:50 PM
Sebastián J. Tosco