Skip to content

Commit 491c280

Browse files
authored
draft (#23049)
1 parent 92a6617 commit 491c280

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/csharp/language-reference/keywords/accessibility-levels.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ Use the access modifiers, `public`, `protected`, `internal`, or `private`, to sp
3434
|----------------|----------------------------------|--------------------------------------------------|
3535
|`enum`|`public`|None|
3636
|`class`|`private`|`public`<br /><br /> `protected`<br /><br /> `internal`<br /><br /> `private`<br /><br /> `protected internal` <br /><br />`private protected`|
37-
|`interface`|`public`|None|
37+
|`interface`|`public`|`public`<br /><br /> `protected`<br /><br /> `internal`<br /><br /> `private`\*<br /><br /> `protected internal` <br /><br />`private protected`|
3838
|`struct`|`private`|`public`<br /><br /> `internal`<br /><br /> `private`|
39-
40-
The accessibility of a nested type depends on its [accessibility domain](./accessibility-domain.md), which is determined by both the declared accessibility of the member and the accessibility domain of the immediately containing type. However, the accessibility domain of a nested type cannot exceed that of the containing type.
39+
40+
\* An `interface` member with `private` accessibility must have a default implementation.
41+
42+
The accessibility of a nested type depends on its [accessibility domain](./accessibility-domain.md), which is determined by both the declared accessibility of the member and the accessibility domain of the immediately containing type. However, the accessibility domain of a nested type cannot exceed that of the containing type.
4143

4244
## C# Language Specification
4345

docs/csharp/programming-guide/interfaces/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The definition of `IEquatable<T>` doesn't provide an implementation for `Equals`
2525

2626
For more information about abstract classes, see [Abstract and Sealed Classes and Class Members](../classes-and-structs/abstract-and-sealed-classes-and-class-members.md).
2727

28-
Interfaces can contain instance methods, properties, events, indexers, or any combination of those four member types. Interfaces may contain static constructors, fields, constants, or operators. For links to examples, see [Related Sections](./index.md#BKMK_RelatedSections). An interface can't contain instance fields, instance constructors, or finalizers. Interface members are public by default.
28+
Interfaces can contain instance methods, properties, events, indexers, or any combination of those four member types. Interfaces may contain static constructors, fields, constants, or operators. For links to examples, see [Related Sections](./index.md#BKMK_RelatedSections). An interface can't contain instance fields, instance constructors, or finalizers. Interface members are public by default, and you can explicitly specify accessibility modifiers, such as `public`, `protected`, `internal`, `private`, `protected internal`, or `private protected`. A `private` member must have a default implementation.
2929

3030
To implement an interface member, the corresponding member of the implementing class must be public, non-static, and have the same name and signature as the interface member.
3131

0 commit comments

Comments
 (0)