Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Object orientation question Date: Wed, 29 Oct 2014 08:35:58 +0100 Lines: 23 Message-ID: References: <0b94f856-9631-48ee-8d2d-94055d79cfd6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 9pziccDBVGQj7LnnMaRg9Q1tRTbGKLr8rtdkV9lCjR1KVPtZ8= Cancel-Lock: sha1:MMgHwCF0JuyC75YYz77xfiD2mJ8= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:30231 On 28.10.2014 10:45, Andreas Leitgeb wrote: > Robert Klemme wrote: >> On 27.10.2014 21:51, Eric Sosman wrote: >>> Clearly, the generated code is the same: AdditionInterface extends >>> BaseInterface, therefore any class implementing AdditionInterface also >>> necessarily implements BaseInterface. If the class fails to provide a >>> method specified by BaseInterface, the code won't compile. So the >>> question is purely about readability and style. >> This is not fully correct: if you check with reflection you will see >> that there is a difference in what Class.getInterfaces() returns. > > You don't even need reflection to notice a difference: > > interface A { ... } | interface A { ... } > interface B { ... } | interface B extends A { ... } > class C implements A,B { ... } | class C implements B { ... } That is not the situation I was referring to. In both _my_ cases B extends A. The difference is just in the declaration what C implements. Cheers robert