About polymorphism
The advantage of programming against a more generic type is that you can use it in a more generic way... Consider that we had written the VehiculeController to use a specific type:Code Snippetclass...
View ArticleAbout polymorphism
timvw, Thank you for your answer. However, I still don't understand what are the benefits of doing Code SnippetVehicule v = new Car();VehiculeController(v); instead of Car v = new...
View ArticleAbout polymorphism
NO, it is NOT dynamic binding, that is a TOTALLY different animal. Polymorphic behavior requires that the item either be of the declared type, or a type derived from that: Code Snippetclass Animal...
View ArticleAbout polymorphism
It's the same principle as programming against an interface:Code SnippetIBase base = new Derived();// Now call functions on base that are defined in IBase...In essence, all you need/want to know in...
View ArticleAbout polymorphism
Sorry if my question sounds confused, I'm not really used to write in English. I would rephraze it as: In what situations would I cast the derived type to a parent type. Thank you.
View ArticleAbout polymorphism
Would you try to rephraze the question?I am not sure if you are asking about when polymorphism is useful or why you would cast the derived type to a parent type.
View ArticleAbout polymorphism
I have a question about polymorphism. I have that simple code which outputsDerived methodDerived method I don't understand what are the good points of doing Base baseDerived = newDerived(); instead of...
View Article
More Pages to Explore .....