Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
java_language_specification_7.pdf
Скачиваний:
13
Добавлен:
21.03.2016
Размер:
3.11 Mб
Скачать

9.2

Interface Members

INTERFACES

InterfaceBody:

{ InterfaceMemberDeclarationsopt }

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 throws clause t declared in Object, unless a method with the same signature, same return type, and a compatible throws clause is explicitly declared by the interface.

It is a compile-time error if the interface explicitly declares such a method m in the case where m is declared to be final in Object.

It follows that is a compile-time error if the interface declares a method with a signature that is override-equivalent (§8.4.2) to a public method of Object, but has a different return type or incompatible throws clause.

The interface inherits, from the interfaces it extends, all members of those interfaces, except for (a) fields, classes, and interfaces that it hides and (b) methods that it overrides (§9.4.1).

268

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]