Polymorphism and Interfaces in Java (can polymorphism be used to implement interfaces…why?)

后端 未结 8 1934
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 17:14

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

相关标签:
8条回答
  • 2020-12-05 17:49

    Another suggestion I'd have for "the real world" is in using spring batch. If you have a commonly used report format that follows a pattern like "pull data, create report, send to recipients" you can create an interface for your reports that enforces this standard. In this sense it works like a "template" that all batch reports would follow.

    A boring example, but it's something I faced in my first year...

    0 讨论(0)
  • 2020-12-05 17:50

    Have you wondered how LINQ in .net works ? It's all about Interfaces and polymorphism.

    You need to work on projects then you will come to know about all this.

    0 讨论(0)
提交回复
热议问题