C#-SchlüsselwörterC# Keywords
Bei Schlüsselwörtern handelt es sich um vordefinierte reservierte Bezeichner, die eine besondere Bedeutung für den Compiler haben.Keywords are predefined, reserved identifiers that have special meanings to the compiler. Sie können nur dann als Bezeichner in einem Programm verwendet werden, wenn @
als Präfix vorangestellt wird.They cannot be used as identifiers in your program unless they include @
as a prefix. Beispiel: @if
ist ein gültiger Bezeichner, aber if
nicht, da if
ein Schlüsselwort ist.For example, @if
is a valid identifier, but if
is not because if
is a keyword.
Die erste Tabelle in diesem Thema enthält die Schlüsselwörter, bei denen es sich in jedem Teil eines C#-Programms um reservierte Bezeichner handelt.The first table in this topic lists keywords that are reserved identifiers in any part of a C# program. Die zweite Tabelle in diesem Thema enthält die kontextabhängigen Schlüsselwörter in C#.The second table in this topic lists the contextual keywords in C#. Kontextabhängige Schlüsselwörter haben nur in einem beschränkten Programmkontext eine besondere Bedeutung und können als Bezeichner außerhalb dieses Kontexts verwendet werden.Contextual keywords have special meaning only in a limited program context and can be used as identifiers outside that context. Im Allgemeinen werden neue Schlüsselwörter als Kontextschlüsselwörter zur C#-Sprache hinzugefügt, um Programme, die mit früheren Versionen geschrieben wurden, nicht zu beschädigen.Generally, as new keywords are added to the C# language, they are added as contextual keywords in order to avoid breaking programs written in earlier versions.
Kontextabhängige SchlüsselwörterContextual keywords
Ein Kontextschlüsselwort wird verwendet, um eine spezifische Bedeutung im Code bereitzustellen, es ist jedoch kein reserviertes Wort in C#.A contextual keyword is used to provide a specific meaning in the code, but it is not a reserved word in C#. Einige kontextabhängige Schlüsselwörter, wie partial
und where
, haben eine besondere Bedeutung in mindestens zwei Kontexten.Some contextual keywords, such as partial
and where
, have special meanings in two or more contexts.
Siehe auchSee also
Feedback
Feedback wird geladen...