Java Reference
In-Depth Information
An interface
I depends
on a reference type
T
if any of the following conditions hold:
•
I
directly depends on
T
.
•
I
directly depends on a class
C
that depends (§
8.1.5
) on
T
.
•
I
directly depends on an interface
J
that depends on
T
(using this definition recurs-
ively).
It is a compile-time error if an interface depends on itself.
then a
ClassCircularityError
is thrown.
9.1.4. Interface Body and Member Declarations
InterfaceBody:
{
InterfaceMemberDeclarations
opt
}
InterfaceMemberDeclarations:
InterfaceMemberDeclaration
InterfaceMemberDeclarations InterfaceMemberDeclaration
InterfaceMemberDeclaration:
ConstantDeclaration
AbstractMethodDeclaration
ClassDeclaration
InterfaceDeclaration
;
The scope of a declaration of a member
m
declared in or inherited by an interface type
I
is
specified in §
6.3
.
9.2. Interface Members
The members of an interface are:
• Those members declared in the interface.
• Those members inherited from direct superinterfaces.
• If an interface has no direct superinterfaces, then the interface implicitly declares a
public abstract
member method
m
with signature
s
, return type
r
, and
throws
clause
t
corresponding to each
public
instance method
m
with signature
s
, return type
r
, and