The C Keywords


The C# Keywords

There are currently 77 keywords defined in the C# language (see Table 2-1). These keywords, combined with the syntax of the operators and separators, form the definition of the C# language. These keywords cannot be used as names for a variable, class, or method.

Table 2-1: The C# Keywords

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

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

volatile

void

while

    

In addition to the keywords, C# defines a set of words that have unique meanings when they are used in certain situations. These are called contextual keywords. They include get, set, yield, value, where, and partial. Because they are not reserved words, outside their context they can be used as names for other program elements, but good practice suggests that it is better not to do so.




C# 2.0(c) The Complete Reference
C# 2.0: The Complete Reference (Complete Reference Series)
ISBN: 0072262095
EAN: 2147483647
Year: 2006
Pages: 300

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net