C# 中的关键字
csharpprogrammingserver side programming更新于 2025/8/13 0:37:17
关键字是 C# 编译器预定义的保留字。这些关键字不能用作标识符。但是,如果您想使用这些关键字作为标识符,可以在关键字前添加 @ 字符。
以下是 C# 中的两种关键字类型。
保留关键字
| abstract | as | base | Bool | break | byte | case |
| catch | char | checked | Class | const | continue | decimal |
| default | delegate | do | Double | else | enum | event |
| explicit | extern | false | Finally | fixed | float | for |
| foreach | goto | if | Implicit | in | in (generic modifier) | int |
| interface | internal | is | Lock | long | namespace | new |
| null | object | operator | Out | out (generic modifier) | override | params |
| private | protected | public | Readonly | ref | return | sbyte |
| sealed | short | sizeof | stackalloc | static | string | struct |
| switch | this | throw | True | try | typeof | uint |
| ulong | unchecked | unsafe | Ushort | using | virtual | void |
| volatile | while |
上下文关键词
| add | alias | ascending | descending | dynamic | from | get |
| global | group | into | join | let | orderby | partial (type) |
| partial(method) | remove | select | set |

