CLASSES
Superinterfaces
8.1.4
8.1.4 Superinterfaces
The optional
implements
clause in a class declaration lists the names of inter
faces that are
direct superinterfaces
of the class being declared:
Interfaces:
implements
InterfaceTypeList
InterfaceTypeList:
InterfaceType
InterfaceTypeList
,
InterfaceType
The following is repeated from 4.3 to make the presentation here clearer:
InterfaceType:
TypeName
Each
InterfaceType
must name an accessible ( 6.6) interface type, or a compile
time error occurs. All interfaces in the current package are accessible. Interfaces
in other packages are accessible if the host system permits access to the package
( 7.4.4) and the interface is declared
public
.
A compile time error occurs if the same interface is mentioned two or more
times in a single
implements
clause, even if the interface is named in different
ways; for example, the code:
class Redundant implements java.lang.Cloneable, Cloneable {
int x;
}
results in a compile time error because the names
java.lang.Cloneable
and
Cloneable
refer to the same interface.
An interface type
I
is a
superinterface
of class type
C
if any of the following
is true:
I
is a direct superinterface of
C
.
C
has some direct superinterface
J
for which
I
is a superinterface, using the
definition of superinterface of an interface given in 9.1.3.
I
is a superinterface of the direct superclass of
C
, using this definition recur
sively.
A class is said to
implement
all its superinterfaces.
135
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved