Abstract Method Confusion.

Community Forums/Monkey Talk/Abstract Method Confusion.

QuickSilva(Posted 2011) [#1]
Just a quick question,

In Blitz Max you can make a base type like TEntity and then extend your other types from this. If TEntity has an abstract method like draw then the extended types must also include their own draw method or else an error occurs. This makes sense.

In Monkey this no longer seems to be the case. I create an Entity class, give it an abstract method, draw and extend a Player class from it. I now purposely leave out the Player classes Draw method yet it still works. Is this the correct behaviour?

Not a problem just wanted to know really why this works.

Thanks for any help,
Jason.

Last edited 2011


MikeHart(Posted 2011) [#2]
Yes, that is how it works.

Why? By design! The advantage is that you can extend a class and don't have redefine these placeholder methods.

Last edited 2011