#2 – The Smallest Possible C# Program

The smallest possible C# program would consist of a static Main() function inside of a class. The namespace is actually optional, as is the args parameter.

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("2,000 Things Was Here..");
        }
    }
}



About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

2 Responses to #2 – The Smallest Possible C# Program

  1. Pingback: #6 – An Even Smaller C# Program « 2,000 Things You Should Know About C#

  2. alan says:

    You can shrink it trivially – you don’t need a namespace declaration ;)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 43 other followers