RajasekharwhY / Build-your-muscle

Learning concepts and sample practice code - C#, MVC, SQL etc..
2 stars 0 forks source link

Keyword, Contextual keyword, Identifier #29

Closed RajasekharwhY closed 5 years ago

RajasekharwhY commented 5 years ago

Identifier :

It is a user defined name of a program element. It can be a name of namespace, class, method, variable or interface. Keyword :

it is a c# predefined and reserved word and it has special meaning to the compiler. Examples of Keywords are int,bool, public , readonly, out, return etc... These keywords can not be used as a user defined Identifier in you program. They cannot be used as identifiers in your program unless they include @ as a prefix. For example, @if is a valid identifier, but if is not because if is a keyword.

Contextual Keyword :

A contextual keyword is used to provide a specific meaning in the code, but it is not a reserved word in C#: Examples of Contextual Keyword : Orderby, nameof, remove etc...Some contextual keywords, such as partial and where, have special meanings in two or more contexts.