java - Cyclic Inheritance Of Interfaces -
i understand why cyclic inheritance of classes not allowed in java did not understand why cyclic inheritance of interfaces not allowed. illustrate:
interface foo extends bar {/*methods , constants*/} interface bar extends foo {/*methods , constants*/} interfaces not need instantiation, prevents them extending each other?
by way, read question not interfaces classes: cyclic inheritance hierarchy in java
thanks in advance.
no, extension of interface way of splitting agreement. remember, interface agreement provide implementation of set of methods.
public interface extends b { public void mymethod(); public void myothermethod(); } you're saying interface a defined these methods , methods in interface b. if interface b says..
public interface b extends {} you're saying interface b defined methods in interface a. defines interface a. couple of methods , interface b. , defines interface b? interface a, defined couple of methods , interface b! see going?
it makes no logical sense allow this.
Comments
Post a Comment