Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
You use void
as the return type of a method (or a local function) to specify that the method doesn't return a value.
public static void Display(IEnumerable<int> numbers)
{
if (numbers is null)
{
return;
}
Console.WriteLine(string.Join(" ", numbers));
}
You can also use void
as a referent type to declare a pointer to an unknown type. For more information, see Pointer types.
You cannot use void
as the type of a variable.
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now