what is public void in c#

What is public void in c#

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.

 

public static void display(IEnumerable<int> num)
{
    if (num is null)
    {
        return;
    }
    Console.WriteLine(string.Join(" ", num));
}

 

2021-10-03