No subject
Sat Nov 12 19:29:10 PST 2005
implementations for its abstract methods. Java programs can use interfaces
to make it unnecessary for related classes to share a common abstract
superclass or to add methods to Object." This explains why we need
interfaces. By using protected methods in interfaces and therby restricting
the visibility you don't get the above mentioned benefit. If your problem
is related to namespace, why don't you use Inner Interfaces ?
Bala
On Fri, 24 Sep 1999 16:20:19 +0530, Dinakaran, Vinod Kumar (CTS) wrote:
> to add complementary comments:
> The semantics of the protected keyword imply an inheritance
> relationship.If protected methods is what you want to access, why dont
you
> subclass?
> Also, the reason for having interfaces in the first place is not
> having to know the implementation, and thereby being insulated from its
> change.
> HTH
> vinod
>
>
> > -----Original Message-----
> > From: Swaminathan_Radhakrishnan
> > [SMTP:swaminathan_radhakrishnan at BMG.Satyam.com]
> > Sent: Friday, September 24, 1999 7:04 AM
> > To: advanced-java; Christian Cryder
> > Subject: RE: Interfaces and protected methods
> > Importance: High
> >
> > Hi,
> > The main reason for defining interfaces is to expose certain
methods
> > to
> > the world. This can mean that the methods have to be public for
everyone
> > to
> > access. If you make the method protected, then only the classes
> > implementing
> > the interface will be having access to the method along with fellow
> > package
> > classes which makes it pointless to have the interface in the first
place.
> > Any other views will be appreciated.
> >
> > Regards,
> > Swami.
> >
> > > ----------
> > > From: Christian Cryder[SMTP:ccryder at realminfo.com]
> > > Sent: Friday, September 24, 1999 11:31 AM
> > > To: advanced-java
> > > Subject: Interfaces and protected methods
> > >
> > > Okey dokey...does anyone have a good explanation for _why_ protected
> > > methods can't be part of an interface? That requirement forces me to
> > know
> > > the specific implementation of an object in order to access protected
> > > methods, which I need to do on certain occasions. It'd be really nice
to
> > > specify protected methods in the interface as well as public.
> > >
> > > I''m just curious if there's a reason (cause I can't think of one).
> > >
> > > Christian
> > > --------------------------------------------
> > > Christian Cryder
> > > Sr. Java Engineer - ApplianceWare
> > > REALM Information Technologies - http://www.realminfo.com
> > > Plugin Version Control for Java (PVCj 1.2) -
> > http://granitepeaks.com/pvcj
> > > --------------------------------------------
> > > "What a great time to be a geek"
> > > --------------------------------------------
> > >
> > >
> > > ---
> > > To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
> > > To get help, mail advanced-java-help at xcf.berkeley.edu
> > >
> >
> > ---
> > To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
> > To get help, mail advanced-java-help at xcf.berkeley.edu
________________________________________________________________
Get FREE voicemail, fax and email at http://voicemail.excite.com
Talk online at http://voicechat.excite.com
---
To unsubscribe, mail advanced-java-unsubscribe at xcf.berkeley.edu
To get help, mail advanced-java-help at xcf.berkeley.edu
More information about the Advanced-java
mailing list