---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 12 Edition"
java_version: 12
chapter: "Chapter 9. Interfaces"
section: "9.5"
heading: "9.5. Member Type Declarations"
parent: "Chapter 9. Interfaces"
source: https://docs.oracle.com/javase/specs/jls/se12/html/jls-9.html#jls-9.5
id: "9.5"
url: https://jvm.obfuscated.software/jls/se12/9.5.html
raw: https://jvm.obfuscated.software/jls/se12/9.5.md
---

# 9.5. Member Type Declarations

Interfaces may contain member type declarations ([§8.5](8.5.md)).

Every member type declaration in the body of an interface is implicitly `public` and `static`. It is permitted to redundantly specify either or both of these modifiers.

It is a compile-time error if a member type declaration in an interface has the modifier `protected` or `private`.

It is a compile-time error if the same keyword appears more than once as a modifier for a member type declaration in an interface.

If an interface declares a member type with a certain name, then the declaration of that type is said to *hide* any and all accessible declarations of member types with the same name in superinterfaces of the interface.

An interface inherits from its direct superinterfaces all the non-`private` member types of the superinterfaces that are both accessible to code in the interface and not hidden by a declaration in the interface.

It is possible for an interface to inherit more than one member type with the same name. Such a situation does not in itself cause a compile-time error. However, any attempt within the body of the interface to refer to any such member type by its simple name will result in a compile-time error, because the reference is ambiguous.

There might be several paths by which the same member type declaration is inherited from an interface. In such a situation, the member type is considered to be inherited only once, and it may be referred to by its simple name without ambiguity.
