C#保留关键字及上下文关键字
C#保留关键字
C#中的保留关键字,不可用于作为程序中的标识符使用,C#中的保留关键字如下表:
abstract | as | base | bool | break |
byte | case | char | catch | checked |
const | class | continue | decimal | default |
delegate | do | double | else | enum |
event | explicit | extern | false | finally |
fixed | float | for | foreach | goto |
if | implicit | in | int | interface |
internal | is | lock | long | namespace |
new | null | object | operator | out |
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 | - | - | - |
C#上下文关键字
上下文关键字用于提供代码中的特定含义,单不是C#中的保留字:
add | async | await | dynamic | get |
global | partial | remove | set | value |
var | where | yield | - | - |
免责声明:内容仅供参考,不保证正确性。