Jon Jagger
jon@jaggersoft.com
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 8 Language Overviewprevious at this levelnext at this level 8.1 Getting startedThe canonical "hello, world" program can be written as follows:
using System;  
class Hello  
{  
   static void Main() {  
      Console.WriteLine("hello, world");  
   }  
}  
The source code for a C# program is typically stored in one or more text files with a file extension of .cs, as in hello.cs. Using a command-line compiler, such a program can be compiled with a command line like
csc hello.cs  
which produces an application named hello.exe. The output produced by this application when it is run is:
hello, world  
Close examination of this program is illuminating: For C and C++ developers, it is interesting to note a few things that do not appear in the "hello, world" program.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS