They are part of the language. They are known as keywords
that are reserved by the language and will be parsed in the compiler explicitly based on what they do. They are reserved, so you cannot do something like this:
User public = new User();
in this I used the "public" keyword as a variable name, which is illegal by C# syntax. If a keyword is found to be inappropriately used, the compiler will not compile your code. (often in IDEs, the compiler wont even get invoked if there is an error)
One thing to note, is that they are NOT operators. (such as + - =). Operators, among many things, can be overloaded (you can define how they mutate your data). In C# (I cannot vouch for other languages), keywords cannot be overloaded.
A keyword
in a programming language is often used to tell the compiler what to do with a specific piece of code within a certain context. Some effects of using certain keywords are more apparent than others. Kind of like a hint to what this code is doing (in your case, what is it's protection level). Each keyword
has it's own rules on what they do. For instance, LINQ has its own operators such as as
, where
, select
which cannot be used like public
, protected
and private
.
For more information about keywords in C#, check out the following:
http://msdn.microsoft.com/en-us/library/x53a06bb.aspx