polymorphism

BlitzMax Forums/BlitzMax Beginners Area/polymorphism

Yue(Posted 2015) [#1]
Hi, I'm trying to understand the polymorphism, the question is to seek information in Spanish, more specifically about c ++ c # and I wonder if this is right in BlitzMax.

I have two types called inheriting class mammals, a dog and a cat, is that these two classes have two method called "Eating", my understanding is that a cat eats differently than eating a dog. In this case the two methods have the same name but have a different way of carrying out the method.

I am right. that is polymorphism?

Type Mammal
   
   Method Eat() Abstract

End Type 


Type Gat Extends Mammal 

     Method Eat()
       Print "Gat Eat"
     End  Method

End Type

Type Dog Extends Mammal 

 Method Eat()
       Print "Dog Eat"
     End 

End Type 






degac(Posted 2015) [#2]
Yes this is right.