0
Is abstract classes are necessary when there is an option called interface is available in java?
2 Antworten
+ 1
Yes. Both interfaces and abstract classes cannot be instantiated themselves and needs a class that is extended by them.
The difference is that a class may inherit from only one abstract class, but may use multiple interfaces.
0
You use them according to your needs. Read more about what is the difference between them and you will know