C# Programming/Keywords/void
Appearance
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:
public void WorkRepeatedly (int numberOfTimes)
{
for(int i = 0; i < numberOfTimes; i++)
if(EarlyTerminationIsRequested)
return;
else
DoWork();
}
C# Keywords | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Special C# Identifiers (Contextual Keywords) | |||||||||||||||
| |||||||||||||||
Contextual Keywords (Used in Queries) | |||||||||||||||
|