In all the examples, I saw that interfaces are used to achieve polymorphism. Now we have the following code with an abstract class
AbstractClass parent = new Child();
Here the man stated that
The general argument is that polymorphism applies only to interfaces and not abstract classes.
I think he meant that they are usually the interfaces that are used in polymorphism in Java. As I can see, many people found their question stupid and wanted a URL. This is what I found. So my question is, is it good practice to propagate abstract classes in polymorphism (as in my example - because polymorphism is a very broad definition) in Java?
java polymorphism oop abstract-class
user2022068
source share