Scope modifiers: Difference between revisions
Content added Content deleted
m (C# minor edit) |
(C# made table clearer) |
||
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 | in same assembly | in same assembly || outside assembly | outside assembly
//-------------------------------------------------------------------------------------------------------
//public | Y | Y | Y | Y▼
//
//protected internal | Yes |
//
//
// C# 7.2:
//private protected |
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.
|