您的位置:首页 > 编程语言 > C#

C# Keywords

2015-11-19 13:41 555 查看

Keywords are predefined, reserved identifiersthat have special meanings to the compiler. They cannot be used as identifiersin
your program unless they include @ as a prefix.
For example, @if is a valid identifier but if is
not because if is a keyword.
Thefirst table in this topic lists keywords that are reserved identifiers in anypart of a C# program. The second table in this topic lists the contextualkeywords in C#. Contextual
keywords have special meaning only in a limitedprogram context and can be used as identifiers outside that context. Generally,as new keywords are added to the C# language, they are added as contextualkeywords in order to avoid breaking programs written in
earlier versions.

 

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
 
 
Contextual Keywords
 
A contextual keyword is used to provide a specific meaning in thecode, but it is not a reserved word in C#. Some contextual keywords, such as partial and where,
have specialmeanings in two or more contexts.

 

add
alias
ascending
async
await
descending
dynamic
from
get
global
group
into
join
let
orderby
partial (type)
partial (method)
remove
select
set
value
var
where (generic type constraint)
where (query clause)
yield
 
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Keywords C#