Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #2991

Re: Why only public methods on interfaces?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!goblin3!goblin.stu.neva.ru!exi-transit.telstra.net!news.telstra.net!exi-spool.telstra.net!exi-reader.telstra.net!not-for-mail
Date Fri, 08 Apr 2011 20:32:57 +1000
From Esmond Pitt <esmond.pitt@bigpond.com>
Reply-To not.esmond.pitt@not.bigpond.com
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Why only public methods on interfaces?
References <25875c94-9af2-4d28-976d-2050a738ae2e@n10g2000yqf.googlegroups.com> <u2otp6tfib1oap453ehfv36vca1tlpfmp5@4ax.com>
In-Reply-To <u2otp6tfib1oap453ehfv36vca1tlpfmp5@4ax.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Lines 25
Message-ID <4d9ee467$0$11199$c30e37c6@exi-reader.telstra.net> (permalink)
NNTP-Posting-Host 120.151.14.51
X-Trace 1302258791 exi-reader.telstra.net 11199 120.151.14.51:41886
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2991

Show key headers only | View raw


On 8/04/2011 8:18 PM, Roedy Green wrote:
> If you could specify that at interface were package
> scope

... which you can ...

, which you would limit all implementors to being in the
> interface's package.

... which again you can.

> In that case, you might as well use an abstract
> class.

Or an interface.

> I too have often wanted non-public methods in interfaces, but that is
> a possible rationale why they are always public.

It doesn't have anything to do with it. Interfaces themselves can be 
specified without an access modifier, which gives them package access; 
and nested interfaces can have any of the access modifiers.

The OP is asking about the access to what is *inside* the interface.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Why only public methods on interfaces? kramer31 <kramer.newsreader@gmail.com> - 2011-04-07 17:09 -0700
  Re: Why only public methods on interfaces? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-04-07 21:48 -0300
  Re: Why only public methods on interfaces? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-04-07 21:01 -0400
    Re: Why only public methods on interfaces? v_borchert@despammed.com (Volker Borchert) - 2011-04-08 02:43 +0000
      Re: Why only public methods on interfaces? Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-04-08 00:24 -0400
  Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-07 21:49 -0700
    Re: Why only public methods on interfaces? Owen Jacobson <angrybaldguy@gmail.com> - 2011-04-08 01:01 -0400
      Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-07 22:37 -0700
        Re: Why only public methods on interfaces? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-08 00:14 -0700
          Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-08 06:59 -0700
            Re: Why only public methods on interfaces? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-08 07:17 -0700
              Re: Why only public methods on interfaces? Patricia Shanahan <pats@acm.org> - 2011-04-08 08:59 -0700
                Re: Why only public methods on interfaces? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-08 17:27 -0700
                Re: Why only public methods on interfaces? "Mike Schilling" <mscottschilling@hotmail.com> - 2011-04-09 22:14 -0700
                Re: Why only public methods on interfaces? "Mike Schilling" <mscottschilling@hotmail.com> - 2011-04-09 22:28 -0700
                Re: Why only public methods on interfaces? Tom Anderson <twic@urchin.earth.li> - 2011-04-10 16:02 +0100
  Re: Why only public methods on interfaces? Roedy Green <see_website@mindprod.com.invalid> - 2011-04-08 03:18 -0700
    Re: Why only public methods on interfaces? Esmond Pitt <esmond.pitt@bigpond.com> - 2011-04-08 20:32 +1000
  Re: Why only public methods on interfaces? Tom Anderson <twic@urchin.earth.li> - 2011-04-08 20:34 +0100
  Re: Why only public methods on interfaces? Tom Anderson <twic@urchin.earth.li> - 2011-04-10 18:10 +0100

csiph-web