Can there be stand alone functions in C# without a Class?

For reference, I want to add the using static addition of C# 6 here.

You can now use methods of a static class without having to type the name of that class over-and-over again. An example matching the question would be:

House.cs

public static class House
{
    public static void Said()
    {
        Console.Write("fatty");
        Console.ReadLine();
    }
}

Program.cs

using static House;

class Program
{
    static void Main()
    {
        Said();
    }
}

Leave a Comment