Our First C# Program
Before we continue with an in depth description of the C# language and the .NET platform, let’s take a look at a simple example, illustrating how a program written in C# looks like:
class HelloCSharp
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello C#!");
}
}
The only thing this program does is to print the message "Hello, C#!" on the default output. It is still early to execute it, which is why we will only take a look at its structure. Later we will describe in full how to compile and run a given program from the command prompt as well as from a development environment.
0 Comments