Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Implimenting Interfaces

Thread view: 
Java Buai - 23 Feb 2006 11:07 GMT
Hi all,

I am very new to Java programming, just learning in fact. Now doing
inheritance of classes and interfaces but need to know:

is it possible for an interface to impliment another interface.

I know a class can impliment any number of interfaces.

Thanks,
Java Buai
Bart Cremers - 23 Feb 2006 11:16 GMT
Any interface can "extend" any number of other interfaces.

Bart
tom fredriksen - 23 Feb 2006 14:31 GMT
> is it possible for an interface to impliment another interface.

An interface is an abstract entity which only declares methods names, so
there can not be any "implements". Only classes can do that. An
interface can only be extended.

/tom
Roedy Green - 23 Feb 2006 15:29 GMT
>> is it possible for an interface to impliment another interface.
>
>An interface is an abstract entity which only declares methods names, so
>there can not be any "implements". Only classes can do that. An
>interface can only be extended.

see http://mindprod.com/jgloss/implement.html
http://mindprod.com/jgloss/extend.html

the terminology in Java is illogical in two respects. I discuss the
absurdities in  those links. No wonder it makes no sense to you.

to add insult to injury they extend interfaces in generics.  I think
at some point they may be declared equivalent, or you code either way
an and  IDE cleans it up.

Perhaps some day either "extends" or "implements" will be deprecated.
Or you will be allowed to implement abstract classes and extend
interfaces with abstract classes. The compiler always knows what you
mean. It is mother-may-I game akin to venery hazing.

See http://mindprod.com/jgloss/venery.html

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Ian Shef - 16 Mar 2006 21:14 GMT
"Java Buai" <homer.slack@ntlworld.com> wrote in news:QHgLf.59671$mf2.918
@newsfe6-win.ntli.net:

> Hi all,
>
> I am very new to Java programming, just learning in fact. Now doing
> inheritance of classes and interfaces but need to know:
>
> is it possible for an interface to impliment another interface.

There is no implementation code in an interface, so it cannot IMPLEMENT
another interface.  However, an interface can EXTEND one or more interfaces.

Examples can be found in the javadocs.  For example,

in javax.swing.event.MouseInputListener

 public interface MouseInputListenerextends MouseListener,
                                            MouseMotionListener

and in java.awt.event MouseListener

 public interface MouseListener extends EventListener

and at the head of the chain in java.util EventListener

 public interface EventListener

Signature

Ian Shef     805/F6      *    These are my personal opinions    
Raytheon Company         *    and not those of my employer.
PO Box 11337             *
Tucson, AZ 85734-1337    *



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.