The difference between contextual keywords and keywords

These three words of context have been touched for a long time, but they have always been ignorant of it, just like Eve and Adam ☺, I saw the async context keyword today and found out that I do n’t understand what the context keyword is and what the keyword has. the difference

async The keyword is a contextual keyword, because it is a keyword only if it modifies a method, lambda expression, or anonymous method. In all other contexts, it will be interpreted as an identifier.

The difference between contextual keywords and keywords:


1. C # keywords: string symbols used to define the C # language, they are predefined reserved identifiers with special meaning to the compiler.
2. Contextual keywords: Identifiers that act as keywords only in specific language structures. The difference with keywords is that context keywords can be used as identifiers in other parts of the code. Certain context keywords (such as partial and where) have special meanings in two or more contexts.

Here you can also talk about the concept of reserved words in java:
reserved words are keywords that are not yet used , but keywords that may be used in the future as the java version is upgraded!

Guess you like

Origin www.cnblogs.com/erlongxizhu-03/p/12693472.html