Polymorphism in Java: Java Interfaces vs Abstract Classes for Designing Flexible Applications
Use interfaces when you care about what an object can do, and use abstract classes when you also need shared state or shared code. That is the simple rule. Polymorphism…