[4393] in java-interest

home help back first fref pref prev next nref lref last post

Re: interfaces

daemon@ATHENA.MIT.EDU (Ken Arnold - Sun Labs)
Thu Dec 21 16:49:18 1995

Date: Thu, 21 Dec 1995 15:04:02 -0500
From: arnold@suneast.East.Sun.COM (Ken Arnold - Sun Labs)
To: pfu.fujitsu.co.jp!satoo@fujitsuI.fujitsu.com
Cc: java-interest@webrunner.neato.org

>Osamu:
>>Ken:
>> A class that declares that it implements an interface, but then
>> only actually implements some of its methods, is an abstract class.
>> This is perfectly legal.
>
>But no class can IMPLEMENT that CLASS because it's a CLASS
>exactly. Suppose no variable accessings are done in method
>bodies of an abstract class. Why can't we assume that class
>as an interface? It does no implementation...

A purely abstract class (one that has *only* abstract methods) is hard
to distinguish from an interface, but if that's what you're producing,
you should produce an interface instead.

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.

		Ken
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post