# C Sharp Programming/Keywords

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 | var | virtual |
| void | volatile | while |
Special C# Identifiers (Contextual Keywords) :
| add | alias | async | await | dynamic |
| get | global | nameof | partial | remove |
| set | value | when | where | yield |
Contextual Keywords (Used in Queries) :
| ascending | by | descending | equals | from |
| group | in | into | join | let |
| on | orderby | select | where |
Abstract classes may contain abstract members in addition to implemented ones. That is, while some of the methods and properties in an abstract class may be implemented, others (the abstract members) may have their signatures defined, but have no implementation. Concrete subclasses derived from an abstract class define those methods and properties.
The as keyword casts an object to a different type. It is therefore similar to the TypeA varA = (TypeA) varB syntax. The difference is that this keyword returns null if the object was of an incompatible type, while the former method throws a type-cast exception in that case.

### See also

* is
The keyword base describes that you would like to refer to the base class for the requested information, not in the current instantiated class.
A base class is the class in which the currently implemented class inherits from. When creating a class with no defined base class, the compiler automatically uses the System.Object base class.
Therefore the two declarations below are equivalent.
Some of the reasons the base keyword is used is:
* Passing information to the base class's constructor
* Recalling variables in the base class, where the newly implemented class is overriding its behaviour
* Recalling methods in the base class. This is useful when you want to add to a method, but still keep the underlying implementation.
The bool keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Boolean. That is, it represents a value of true or false. Unlike in C++, whose boolean is actually an integer, a bool in C# is its own data type and cannot be cast to any other primitive type.
The keyword break is used to exit out of a loop or switch block.

#### break as used in a loop

The while loop would increment x as long as it was less than twenty. However when x is incremented to ten the condition in the if statement becomes true, so the break statement causes the while loop to be broken and execution would continue after the closing parentheses.

#### break as used in a switch block

When the program enters the switch block, it will search for a case statement that is true. Once it finds one, it will read any further statements printed until it finds a break statement. In the above example, if x is 0 or 1, the console will only print their respective values and then jump out of the statement. However, if the value of x is 2 or 3, the program will read the same proceeding statement(s) until it reaches a break statement. In order not to show anybody who reads the code that this handling for 2 is the same for three, it is good programming practice to add a comment like "falls through" after the falling-through cases.
The byte keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Byte. That is, it represents an 8-bit unsigned integer whose value ranges from 0 to 255.
The keyword case is often used in a switch statement.
The keyword catch is used to identify a statement or statement block for execution, if an exception occurs in the body of the enclosing try block. The catch clause is preceded by the try clause, and may optionally be followed by a finally clause.
The char keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Char. That is, it represents a Unicode character whose from 0 to 65,535.
The checked and unchecked operators are used to control the overflow checking context for integral-type arithmetic operations and conversions. It checks, if there is an overflow (this is default).

#### See also

The class keyword is used to declare a class.
The const keyword is used in field and local variable declarations to make the variable constant. It is thus associated with its declaring class or assembly instead of with an instance of the class or with a method call. It is syntactically invalid to assign a value to such a variable anywhere other than its declaration.

#### Further reading

* Constant function parameters
The keyword continue can be used inside any loop in a method. Its affect is to end the current loop iteration and proceed to the next one. If executed inside a for, end-of-loop statement is executed (just like normal loop termination).
The decimal keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Decimal. That is, it represents a signed, 128-bit decimal number whose value is 0 or a decimal number with 28 or 29 digits of precision ranging either from $-1.0\times 10^{-28}$ to $-7.9\times 10^{28}$ or from $1.0\times 10^{-28}$ to $7.9\times 10^{28}$.
The default keyword can be used in the switch statement or in generic code:
* The switch statement: Specifies the default label.
* Generic code: Specifies the default value of the type parameter. This will be null for reference types and zero for value types.

## References

* ↑ "default (C# Reference)". http://msdn.microsoft.com/en-us/: MSDN. Retrieved 2011-08-09. {{cite web}}: External link in |location= (help)
The delegate keyword is used to declare a delegate. A delegate is a programming construct that is used to obtain a callable reference to a method of a class.
The do keyword identifies the beginning of a do ... loop.
The double keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Double. That is, it represents an IEEE 754, 64-bit signed binary floating point number whose value is negative 0, positive 0, negative infinity, positive infinity, not a number, or a number ranging either from $-5.0\times 10^{-324}$ to $-1.79\times 10^{308}$ or from $5.0\times 10^{-324}$ to $1.79\times 10^{308}$.
The else keyword identifies a else clause of an if statement with the following syntax:
    if-statement ::= "if" "(" condition ")" if-body "else" else-body
    condition ::= boolean-expression
    if-body ::= statement-or-statement-block
    else-body ::= statement-or-statement-block
An else clause immediately follows an if-body. It provides code to execute when the condition is false. Making the else-body another if statement creates the common cascade of if, else if, else if, else if, else statements:
The above example only checks whether myNumber is less than 0, if myNumber is not 4. It in turn only checks whether myNumber%2 is 0, if myNumber is not less than 0. Since none of the conditions are true, it executes the body of the final else clause.
The enum keyword identifies an enumeration.
The event keyword is used to declare an event.

### General

When values are cast implicitly, the runtime does not need any casting in code by the developer in order for the value to be converted to its new type.
Here is an example, where the developer is casting explicitly:
The developer has told the runtime, "I know what I'm doing, force this conversion."
Implicit casting means that runtime doesn't need any prompting in order to do the conversion. Here is an example of this.

### Keyword

Notice that no casting was necessary by the developer. What is special about implicit, is that the context that the type is converted to is totally lossless i.e. converting to this type loses no information, so it can be converted back without worry.
The explicit keyword is used to create type conversion operators that can only be used by specifying an explicit type cast.
This construct is useful to help software developers write more readable code. Having an explicit cast name makes it clear that a conversion is taking place.
The keyword extern indicates that the method being called exists in a DLL.
A tool called tlbimp.exe can create a wrapper assembly that allows C# to interact with the DLL like it was a .NET assembly i.e. use constructors to instantiate it, call its methods.
Older DLLs will not work with this method. Instead, you have to explicitally tell the compiler what DLL to call, what method to call and what parameters to pass. Since parameter type is very important, you can also explicitly define what type the parameter should be passed to the method as.
Here is an example:
The [DllImport("user32.dll")] tells the compiler which DLL to reference. Windows searches for files as defined by the PATH environment variable, and therefore will search those paths before failing.
The method is also static because the DLL may not understand how to be "created", as DLLs can be created in different languages. This allows the method to be called directly, instead of being instantiated and then used.
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 | var | virtual |
| void | volatile | while |
Special C# Identifiers (Contextual Keywords) :
| add | alias | async | await | dynamic |
| get | global | nameof | partial | remove |
| set | value | when | where | yield |
Contextual Keywords (Used in Queries) :
| ascending | by | descending | equals | from |
| group | in | into | join | let |
| on | orderby | select | where |
The false keyword is a boolean constant value.
The keyword finally is used to identify a statement or statement block after a try-catch block for execution regardless of whether the associated try block encountered an exception, and executes even after a return statement. The finally block is used to perform cleanup activities.
The fixed keyword is used to prevent the garbage collector from relocating a variable. You may only use this in an unsafe context.
If you are using C# 2.0 or greater, the fixed may also be used to declare a fixed-size array. This is useful when creating code that works with a COM project or DLL.
Your array must be composed of one of the primitive types: bool, byte, char, double, float, int, long, sbyte, short, ulong, or ushort.
The float keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Single. That is, it represents a IEEE 754, 32-bit signed binary floating point number whose value is negative 0, positive 0, negative infinity, positive infinity, not a number, or a number ranging either from $-1.5\times 10^{-45}$ to $-3.4\times 10^{38}$ or from $1.5\times 10^{-45}$ to $3.4\times 10^{38}$.
The for keyword identifies a for loop.
The foreach keyword identifies a foreach loop.
The goto keyword returns the flow of operation to the label which follows it. Labels can be created by putting a colon after any word. e.g.
The use of goto is very controversial, because, when used frivolously, it creates code that jumps from place to place and is disorganized and hard to read. It is rarely even necessary because the same thing can often be accomplished with a more organized for loop or while loop.
The if keyword identifies an if statement with the following syntax:
    if-statement ::= "if" "(" condition ")" if-body ["else" else-body]
    condition ::= boolean-expression
    if-body ::= statement-or-statement-block
    else-body ::= statement-or-statement-block
If the condition evaluates to true, the if-body executes. Curly braces ("{" and "}") allow the if-body to contain more than one statement. Optionally, an else clause can immediately follow the if-body, providing code to execute when the condition is false. Making the else-body another if statement creates the common cascade of if, else if, else if, else if, else statements:
The boolean expression used in an if statement typically contains one or more of the following operators:
| Operator | Meaning | Operator | Meaning |
| < | less than | > | greater than |
| == | equal to | != | not equal to |
| <= | less than or equal to | >= | greater than or equal to |
| && | and | || | or |
| ! | not |
See also else.

### General

When values are cast implicitally, the runtime does not need any casting in code by the developer in order for the value to be converted to its new type.
Here is an example, where the developer is casting explicitly:
The developer has told the runtime, "I know what I'm doing, force this conversion."
Implicit casting means that runtime doesn't need any prompting in order to do the conversion. Here is an example of this.
Notice that no casting was necessary by the developer. What is special about implicit is that the context that the type is converted to is totally lossless, i.e. converting to this type loses no information. So, it can be converted back without worry.

### Keyword

The keyword implicit is used for a type to define how to can be converted implicitly. It is used to define what types can be converted to without the need for explicit casting.
As an example, let us take a Fraction class, that will hold a nominator (the number at the top of the division), and a denominator (the number at the bottom of the division). We will add a property so that the value can be converted to a float.
To re-iterate, the value it implicitally casts to must hold data in the form that the original class can be converted back to. If this is not possible, and the range is narrowed (like converting double to int), use the explicit operator.
The in keyword identifies the collection to enumerate in a foreach loop.
The in keyword may also be used in a query, e.g., 'from item in dataset'. Immediately following the contextual keyword from is a range variable representing one item in the dataset. The dataset to be queried is defined immediately following the contextual keyword in. See also ascending, descending, in, orderby, select, and where.
The int keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Int32. That is, it represents a 32-bit signed integer whose value ranges from -2,147,483,648 to 2,147,483,647.
The interface keyword is used to declare an interface. Interfaces provide a construct for a programmer to create types that can have methods, properties, delegates, events, and indexers declared, but not implemented.
It is a good programming practice to give interfaces differing names from classes that start with an I and/or finish with ...able, like IRun or Runnable or IRunnable.
The internal keyword is an access modifier used in field, method, and property declarations to make the field, method, or property internal to its enclosing assembly. That is, it is only visible within the assembly that implements it.
The is keyword compares an object to a type, and if they're the same or of the same "kind" (the object inherits the type), returns true. The keyword is therefore used to check for type compatibility, usually before casting (converting) a source type to a destination type in order to ensure that won't cause a type-cast exception to be thrown. Using is on a null variable always returns false.
This code snippet shows a sample usage:
The lock keyword allows a section of code to exclusively use a resource, a feature useful in multi-threaded applications. If a lock to the specified object is already held when a piece of code tries to lock the object, the code's thread is blocked until the object is available.
The parameter to the lock statement must be an object reference, not a value type:
The long keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Int64. That is, it represents a 64-bit signed integer whose value ranges from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
The namespace keyword is used to supply a namespace for class, structure, and type declarations.
The new keyword has two different meanings:
* It is an operator that requests a new instance of the class identified by its argument.
* It is a modifier that explicitly hides a member.
As an example, see the code below:
The null keyword represents an empty value for a reference type variable, i.e. for a variable of any type derived from System.Object. In C# 2.0, null also represents the empty value for nullable value type variables.
The object keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Object. That is, it represents the base class from which all other reference types derive. On some platforms, the size of the reference is 32 bits, while on other platforms it is 64 bits.
The operator keyword allows a class to overload arithmetic and cast operators:
The out keyword explicitly specifies that a variable should be passed by reference to a method, and set in that method. A variable using this keyword must not be intialized before the method call to ensure the developer understand its intended effects. Using this keyword requires the called method to set the variable using this modifier before returning. Using out also requires the developer to specify the keyword even in the calling code, to ensure that it is easily visible to developers reading the code that the variable will have its value changed elsewhere, which is useful when analyzing the program flow.
An example of passing a variable with out follows:
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 | var | virtual |
| void | volatile | while |
Special C# Identifiers (Contextual Keywords) :
| add | alias | async | await | dynamic |
| get | global | nameof | partial | remove |
| set | value | when | where | yield |
Contextual Keywords (Used in Queries) :
| ascending | by | descending | equals | from |
| group | in | into | join | let |
| on | orderby | select | where |
The keyword override is use in declaring an overridden function, which extends a base class function of the same name.

#### Further reading

* Inheritance keywords
The keyword params is used to describe when a grouping of parameters are passed to a method, but the number of parameters are not important, as they may vary. Since the number isn't important, the params keyword must be the last variable in a method signature so that the compiler can deal with the parameters which have been defined first, before dealing with the params.
Here are examples of where it will, and will not work:
A good example of this is the String.Format method. The String.Format method allows a user to pass in a string formatted to their requirements, and then many parameters for the values to insert into the string. Here is an example:
The String.Format method has taken a string, and replaced the {0}, {1}, {2} with the 1st, 2nd and 3rd parameters. If the params keyword did not exist, then the String.Format would need an infinite number of overloads to cater for each case.
The private keyword is used in field, method, and property declarations to make the field, method, or property private to its enclosing class. That is, it is not visible outside of its class.
The protected keyword is used in field, method, and property declarations to make the field, method, or property protected to its enclosing class. That is, it is not visible outside of its class.
The public keyword is used in field, method, and property declarations to make the field, method, or property public to its enclosing class. That is, it is visible from any class.
The readonly keyword is closely related to the const keyword at a glance, with the exception of allowing a variable with this modifier to be initialized in a constructor, along with being associated with a class instance (object) rather than the class itself.
The primary use for this keyword is to allow the variable to take on different values depending on which constructor was called, in case the class has many, while still ensuring the developer that it can never intentionally or unintentionally be changed in the code once the object has been created.
This is a sample usage, assumed to be in a class called SampleClass:
The ref keyword explicitly specifies that a variable should be passed by reference rather than by value.
A developer may wish to pass a variable by reference particularly in case of value types. If a variable is passed by reference, only a pointer is sent to a function in reality, reducing the cost of a method call in case it would involve copying large amounts of data, something C# does when normally passing value types.
Another common reason to pass a variable by reference is to let the called method modify its value. Because this is allowed, C# always enforces specifying that a value is passed by reference even in the method call, something many other programming languages don't. This let developers reading the code easily spot places that can imply a type has had its value changed in a method, which is useful when analyzing the program flow.
Passing a value by reference does not imply that the called method has to modify the value; see the out keyword for this.
Passing by reference requires the passed variable to be initialized.
An example of passing a variable by reference follows:
The return keyword is used to return execution from a method or from a property accessor. If the method or property accessor has a return type, the return keyword is followed by the value to return.
The sbyte keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.SByte. That is, it represents an 8-bit signed integer whose value ranges from -128 to 127.
The sealed keyword is used to specify that a class cannot be inherited from. The following example shows the context in which it may be used:
Notice: The sealed class inheritance is the same as that of a final class in Java.
The short keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.Int16. That is, it represents a 16-bit signed integer whose value ranges from -32,768 to 32,767.
The sizeof keyword returns how many bytes an object requires to be stored.
An example usage:
The keyword stackalloc is used in an unsafe code context to allocate a block of memory on the stack.
In the example above, a block of memory of sufficient size to contain 100 elements of type int is allocated on the stack, not the heap; the address of the block is stored in the pointer fib. This memory is not subject to garbage collection and therefore does not have to be pinned (via fixed). The lifetime of the memory block is limited to the lifetime of the method in which it is defined (there is no way to free the memory before the method returns).
stackalloc is only valid in local variable initializers.
Because Pointer types are involved, stackalloc requires unsafe context. See Unsafe Code and Pointers.
stackalloc is similar to _alloca in the C run-time library.
Note* - From MSDN
The static keyword is used to declare a class or a class member (method, property, field, or variable) as static. A class that is declared static has only static members, and these are associated with the entire class instead of class instances.
The string keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for System.String. That is, it indicates an immutable sequence of characters.
The struct keyword declares a structure, i.e. a value type that functions as a light-weight class.
The switch statement is a control statement that handles multiple selections and enumerations by passing control to one of the case statements within its body.
This is an example of a switch statement:
The this keyword is used in an instance method or instance property to refer to the current class instance. That is, this refers to the object through which its containing method or property was invoked. It is also used to define extension methods.
The throw keyword is used to throw an exception object.
The true keyword is a Boolean constant value. Therefore
would create an infinite loop.
The try keyword is used to identify a statement or statement block as the body of an exception handling sequence. The body of the exception handling sequence must be followed by a catch clause, a finally clause, or both.
The typeof keyword returns an instance of the System.Type class when passed a name of a class. It is similar to the sizeof keyword in that it returns a value instead of starting a section (block) of code (see if, try, while).
An example:
The output will be:
It should be noted that unlike sizeof, only class names themselves and not variables can be passed to typeof as shown here:
using System;
Sometimes, classes will include their own GetType method that will be similar, if not identical, to typeof.
The uint keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.UInt32. That is, it represents a 32-bit unsigned integer whose value ranges from 0 to 4,294,967,295.
The ulong keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.UInt64. That is, it represents a 64-bit unsigned integer whose value ranges from 0 to 18,446,744,073,709,551,615.
The unchecked keyword prevents overflow-checking when doing integer arithmetics. It may be used as an operator on a single expression or as a statement on a whole block of code.
The unsafe keyword may be used to modify a procedure or define a block of code which uses unsafe code. Code is unsafe if it uses the "address of" (&) or pointer operator (*).
In order for the compiler to compile code containing this keyword, you must use the unsafe option when using the Microsoft C-Sharp Compiler.
The ushort keyword is used in field, method, property, and variable declarations and in cast and typeof operations as an alias for the .NET Framework structure System.UInt16. That is, it represents a 16-bit unsigned integer whose value ranges from 0 to 65,535.
The using keyword has two completely unrelated meanings in C#, depending on if it is used as a directive or a statement.

## The directive

using as a directive resolves unqualified type references so that a developer doesn't have to specify the complete namespace.
Example:
using can also provide a namespace alias for referencing types.
Example:

## The statement

using as a statement automatically calls the dispose on the specified object. The object must implement the IDisposable interface. It is possible to use several objects in one statement as long as they are of the same type.
Example:
The var keyword can be used in place of a type when declaring a variable to allow the compiler to infer the type of the variable. This feature can be used to shorten variable declarations, especially when instantiating generic types, and is even necessary with LINQ expressions (since queries may generate very complex types).
The following:
is equivalent to:
var does not create a "variant" type; the type is simply inferred by the compiler. In situations where the type cannot be inferred, the compiler generates an error:
Note: Var is not a keyword
The keyword virtual is applied to a method declaration to indicate that the method may be overridden in a subclass. If the virtual keyword is not applied and a method is defined in a subclass with the same signature as the one in the parent class, the method in the parent class is hidden by the subclass implementation. With other words, it is only possible to have a true polymorphism of functions with this keyword.
Notice: Comparing it with Java, a method is not virtual if and only if it is final. This is the result of different design philosophies.
The void keyword is used in method signatures to declare a method that does not return a value. A method declared with the void return type cannot provide any arguments to any return statements they contain.
Example:
The volatile keyword is used to declare a variable that may change its value over time due to modification by an outside process, the system hardware, or another concurrently running thread.
You should use this modifier in your member variable declaration to ensure that whenever the value is read, you are always getting the most recent (up-to-date) value of the variable.
This keyword has been part of the C# programming language since .NET Framework 1.1 (Visual Studio 2003).
The while keyword identifies a while loop.
Special C# Identifiers
The add and remove keywords allow you to execute code whenever a delegate is added or removed from an event. Its usage is similar to the get and set keywords with properties:
The code in the add block will be executed when a delegate is added to the event. Similarly, the code in the remove block will be executed when a delegate is removed from the event.
The alias keyword is used to indicate an external alias.
When you need to use several versions of the same assembly or assemblies with the same full qualified typenames, you need to use the alias and extern keywords to give different alias names for each version.
Example:
To use the typenames of each version, you have the operator :: .
Example:
However, this only says to the compiler that there are several assemblies with typename conflicts. To relate what of each assemblies match's the alias name, you have to tell the compiler on its options apart the source. On dotNet command line, this options would be:
/r:AppTools=AppToolsv100.dll /r:AppToolsV2=AppToolsv200.dll
Notice: In order for it to be of use, you need to provide an external assembly to the compiler (e.g. pass /r:EXTALIAS=XXX.dll) and identify the external alias within the code (e.g. extern alias EXTALIAS;)
The special identifier get is used to declare the read accessor for a property.
The global keyword is useful in some contexts to resolve ambiguity between identifiers. If you have a conflict between a class name and a namespace, for example, you can use the global keyword to access the namespace:
global does not work in the following situation, however, as our System class does not have a namespace:
The special identifier partial is used to allow developers to build classes from different files and have the compiler generate one class, combining all the partial classes. This is mostly useful for separating classes into separate blocks. For example, Visual Studio 2005 separates the UI code for forms into a separate partial class that allows you to work on the business logic separately.
The special identifier set is used to declare the write accessor for a property.
The special identifier value is used in a property's write accessor to represent the value requested for assignment to the property.
The where keyword has two different meanings:
* It is used to specify one or more constraints on generic type parameters.
* With LINQ, it is used to query a data source and select or filter elements to return.
The yield keyword returns the next value from an iterator or ends an iteration.

## Notes

The reference list of C# keywords is at .