Constants cannot be marked with which of the below keywords
-
Public.
-
Private.
-
Protected.
-
static.
-
Internal.
-
ProtectedInternal.
In C#, constants (marked with 'const' keyword) are implicitly static and cannot be marked with the 'static' keyword explicitly. Access modifiers like public, private, protected, and internal are all valid for constants - they control visibility. ProtectedInternal is also valid. Attempting to mark a constant as static would cause a compilation error.
A const member in C#/.NET is implicitly a compile-time constant that belongs to the type itself, not to instances, and the compiler already treats it as static — you're not allowed to redundantly (and conflictingly) mark it static yourself. Access modifiers like public, private, protected, and internal (including protected internal) are all still valid on a constant.