[4402] in java-interest
Re: interfaces
daemon@ATHENA.MIT.EDU (Jeremy Fitzhardinge)
Fri Dec 22 03:44:59 1995
From: "Jeremy Fitzhardinge" <jeremy@suede.sw.oz.au>
Date: Fri, 22 Dec 1995 18:14:48 -0500
In-Reply-To: arnold@suneast.east.sun.com (Ken Arnold - Sun Labs)
"Re: interfaces" (Dec 21, 3:04pm)
To: arnold@suneast.East.Sun.COM (Ken Arnold - Sun Labs),
pfu.fujitsu.co.jp!satoo@fujitsuI.fujitsu.com
Cc: java-interest@webrunner.neato.org
On Dec 21, 3:04pm, Ken Arnold - Sun Labs wrote:
> Some people have suggested that you be able to say "class Foo
> implements Bar" where Bar is another class, meaning that it supports
> all the methods, but inherits no implementation. That would be
> consistent with the language, but I don't think it's under
> consideration, currently. If you think this would be a good idea,
> submit it as a requested enhnancement.
If a fully abstract class is just a class which claims to implement an
interface but provides no implementation itself, then its effectively
an interface itself. If you want to treat it as one, then you may as
well make it an interface. If you want to have it as a class with no
methods of its own but it has some fields, then that is providing an
implementation to some extent, and it shouldn't be possible to treat it
as an interface. I don't think allowing a class to implement a
fully abstract class is consistent with the language, since it would
either be introducing multiple inheritance or be a useless frill which
adds nothing to the expressiveness of the language.
A more important question about interfaces: will Java provide a
mechanism for referring to a method of a particular implemented
interface? If class Foo implements Bar and Groo, and both interfaces
have a method of the same name, there's no way Foo can implement both.
Not only is there no syntax for this, but there's no way of
representing it in a class file.
J
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com