In fact, you can extend interfaces in Java, but it will still be called an interface.
Then you can use this advanced interface implemented in your abstract class.
interface InterfaceName { public void foo(); } public interface ExtendedInterface extends InterfaceName { public void bar(); } public class ClassName implements ExtendedInteface {
Right, this is exactly how the designers designed it. It goes back to the philosophy of Java and how to use classes and interfaces. Suppose you have the following classes: Student, Professor, Employee, Technician. And the following interfaces: demography, Paydetails and Personaldetails.
Ideally, a professor of classes and a technician can be expanded from a class member, and that makes sense. However, imagine how to extend a class of techniques from demographics or personal data. It does not make sense. Its like an extension of the class sky from class blue. Just because you can do it doesn’t mean you have to do it. However, it makes sense to have a class specialist from the staff and implement interfaces such as Paydetails or demographics. Its like an extension of the sky from nature, but the implementation of the interface is blue (gives it the functionality of blue).
This is the main reason Java developers opposed multiple inheritance (as opposed to cpp) and used interfaces instead. In your question, it doesn't matter if the class is abstract or not. You simply cannot expand from the interface because it does not make sense logically.
source share