#2 – The Smallest Possible C# Program
June 19, 2010 2 Comments
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..");
}
}
}
Pingback: #6 – An Even Smaller C# Program « 2,000 Things You Should Know About C#
You can shrink it trivially – you don’t need a namespace declaration