Last active
January 17, 2018 11:18
-
-
Save Manuzor/e218b8faa7400ebfb2da1ce93c9af913 to your computer and use it in GitHub Desktop.
Shows the default access levels in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Name.Space | |
{ | |
/* internal */ class TopLevelClass | |
{ | |
/* private */ int Field; | |
/* private */ TopLevelClass() { } | |
/* private */ void Method() { } | |
/* private */ class NestedClass | |
{ | |
// Same rules apply as for the contents of TopLevelClass | |
} | |
/* private */ class NestedStruct | |
{ | |
// Same rules apply as for the contents of TopLevelClass | |
/* private */ int Field; | |
} | |
/* private */ enum NestedEnum | |
{ | |
// This behaves always like public. Adding access modifiers is not allowed! | |
/* public */ Value0 | |
} | |
/* private */ delegate void TopLevelDelegate(); | |
/* private */ interface TopLevelInterface; | |
} | |
/* internal */ struct TopLevelStruct | |
{ | |
// Same rules apply as for the contents of TopLevelClass | |
} | |
/* internal */ enum TopLevelEnum | |
{ | |
// This behaves always like public. Adding access modifiers is not allowed! | |
/* public */ Value0 | |
} | |
/* internal */ delegate void TopLevelDelegate(); | |
/* internal */ interface TopLevelInterface | |
{ | |
// This behaves always like public. Adding access modifiers is not allowed! | |
/* public */ void InterfaceMethod(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment