Skip to content

Commit f48cb8c

Browse files
v-maudelBillWagner
authored andcommitted
CC59892: Removing "public" from code (#5955)
Hello, @mairaw, This proposed file change comes from dotnet/docs.ru-ru#110. Contributor comment: "You can not use access modifiers with explicit implementation" Could you review this contribution and help to merge if agreed? Many thanks in advance.
1 parent b7636a4 commit f48cb8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/csharp/programming-guide/indexers/indexers-in-interfaces.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ Indexers can be declared on an [interface](../../../csharp/language-reference/ke
2929
In the preceding example, you could use the explicit interface member implementation by using the fully qualified name of the interface member. For example:
3030

3131
```
32-
public string ISomeInterface.this[int index]
32+
string ISomeInterface.this[int index]
3333
{
3434
}
3535
```
3636

3737
However, the fully qualified name is only needed to avoid ambiguity when the class is implementing more than one interface with the same indexer signature. For example, if an `Employee` class is implementing two interfaces, `ICitizen` and `IEmployee`, and both interfaces have the same indexer signature, the explicit interface member implementation is necessary. That is, the following indexer declaration:
3838

3939
```
40-
public string IEmployee.this[int index]
40+
string IEmployee.this[int index]
4141
{
4242
}
4343
```
4444

4545
implements the indexer on the `IEmployee` interface, while the following declaration:
4646

4747
```
48-
public string ICitizen.this[int index]
48+
string ICitizen.this[int index]
4949
{
5050
}
5151
```

0 commit comments

Comments
 (0)