void (C# Reference)


Updated: July 20, 2015

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

When used as the return type for a method, void specifies that the method doesn't return a value.

void isn't allowed in the parameter list of a method. A method that takes no parameters and returns no value is declared as follows:

public void SampleMethod()  
    // Body of the method.  

void is also used in an unsafe context to declare a pointer to an unknown type. For more information, see Pointer types.

void is an alias for the .NET Framework System.Void type.

For more information, see the C# Language Specification. The language specification is the definitive source for C# syntax and usage.

C# Reference
C# Programming Guide
C# Keywords
Reference Types
Value Types
Unsafe Code and Pointers