Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Daniel Pitts Newsgroups: comp.lang.java.programmer Subject: Re: "implements" does not mean "implements" Date: Thu, 10 Nov 2016 09:02:55 -0800 Organization: A noiseless patient Spider Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 10 Nov 2016 17:02:26 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="78267a496899f1f82967c6641e46249a"; logging-data="22092"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182w3idWZzMEJl0aPd+MXJSloZEsRi1Pdo=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 In-Reply-To: Cancel-Lock: sha1:UgtW8FwuvDTWUw4E/kRZVEygFes= Xref: csiph.com comp.lang.java.programmer:35889 On 11/9/16 4:45 PM, Stefan Ram wrote: > Just a small thought I had on the train today: > > "implements" does not always mean "implements". > > For example, this compiles: > > interface A { void m(); } > > abstract class C implements A { public abstract void m(); } > > public final class Main > { public static void main( final java.lang.String args[] ) > { java.lang.System.out.println( "2016-11-10" ); }} > > C does not implement A, yet is says »C implements A«. > > The program compiles and prints > > 2016-11-10 > > . > Sure it does, it tells the compiler that any time you have an Object of type C, it implements interface A. This is true, since any concrete subclass of C would need to implement void m();