Scope modifiers: Difference between revisions
m
Updated for C# 7.2
(Added Kotlin) |
m (Updated for C# 7.2) |
||
Line 300:
protected internal //visible to anything inside the same assembly and also to derived classes outside the assembly.
private //visible only to the current class.
C# 7.2 adds:
private protected //visible to current class and to derived classes inside the same assembly.
//Modifier | Class | Assembly | Subclass | World
Line 307 ⟶ 309:
//protected | Y | N | Y | N
//internal | Y | Y | N | N
//private | Y | N | N | N
// C# 7.2:
//private protected | Y | N | Y/N | N</lang>
If no modifier is specified, it defaults to the most restrictive one.<br/>
In case of top-level classes/structs/interfaces/enums this means internal, otherwise it means private.
|