Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (30 sloc) 1.19 KB
title ms.date f1_keywords helpviewer_keywords ms.assetid
void - C# Reference
07/20/2015
void_CSharpKeyword
void
void keyword [C#]
0d2d8a95-fe20-4fbd-bf5d-c1e54bce71d4

void (C# Reference)

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 xref:System.Void?displayProperty=nameWithType type.

C# language specification

[!INCLUDECSharplangspec]

See also

You can’t perform that action at this time.