oop - Are interfaces redundant with multiple inheritance? -


this not yet question difference between abstract classes , interfaces, please think twice before voting close it.

i aware interfaces essential in oop languages don't support multiple inheritance - such c# , java. with multiple inheritance? concept of interface (as specific language feature) redundant in language multiple inheritance? guess oop "contract" between classes can established using abstract classes.

or, put bit more explicitly, interfaces in c# , java consequence of fact not support multiple inheritance?

... lack of multiple inheritance forced add concept of interfaces...

so yes, believe interfaces redundant given multiple inheritance. use pure abstract base classes in language supporting multiple inheritance or mix-ins.

that said, i'm quite happy single inheritance of time. eric lippert makes point earlier in same volume (p. 10) choice of single inheritance "... eliminates in 1 stroke many of complicated corner cases..."


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -