In the real world what do people use this for (to solve what types of problems)? Can I see some example code of these working together? All I can find is code about cats and dogs speaking or people drinking milk or coffee…
Do people really implement polymorphism with interfaces? What for?
Sure,
Below is concrete example of the “Observer” pattern, using classes and interfaces to accomplish polymorphic behavior in a logger system:
Then, you could use it as follows:
Hope this helps your understanding of interfaces and polymorphism.