Category: polymorphism

How to instantiate a class that has a constructor requiring an interface object

I am trying to use the Interactive Brokers Java API to see if I can do some algorithmic trading (on paper initially). I want to call a method called ReqMktDepth() which is in a class called EClientSocket. The EClientSocket constructor requires an object of type AnyWrapper to be passed, and AnyWrapper is an interface not […]

Is what seems like polymorphism in PHP really polymorphism?

Trying to figure out whether PHP supports features like method overloading, inheritance, and polymorphism, I found out: it does not support method overloading it does support inheritance but I am unsure about polymorphism. I found this Googling the Internet: I should note that in PHP the polymorphism isn’t quite the way it should be. I […]