Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: Roedy Green Newsgroups: comp.lang.java.programmer Subject: Re: Why only public methods on interfaces? Date: Fri, 08 Apr 2011 03:18:47 -0700 Organization: Canadian Mind Products Lines: 22 Message-ID: References: <25875c94-9af2-4d28-976d-2050a738ae2e@n10g2000yqf.googlegroups.com> Reply-To: Roedy Green NNTP-Posting-Host: RCd/Ul4tyxGUBII8WGwa5g.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 6.00/32.1186 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2990 On Thu, 7 Apr 2011 17:09:51 -0700 (PDT), kramer31 wrote, quoted or indirectly quoted someone who said : >Could someone please explain to me the rational behind only allowing >public methods on interfaces? In my mind, protection and interfaces >are two independent if perhaps somewhat related concepts. Interfaces are for gluing things together that have different ancestries. If you could specify that at interface were package scope, which you would limit all implementors to being in the interface's package. In that case, you might as well use an abstract class. I too have often wanted non-public methods in interfaces, but that is a possible rationale why they are always public. -- Roedy Green Canadian Mind Products http://mindprod.com Doing what the user expects with respect to navigation is absurdly important for user satisfaction. ~ anonymous Google Android developer