December 2002
Intermediate to advanced
720 pages
17h 39m
English
A simple hello world application written in C# follows:
namespace HelloWorld
{
using System;
public class Hello
{
public Hello()
{
// Constructor logic goes here
}
public static int Main(string[] args)
{
Console.WriteLine("Hello: ");
if (args.Length==0)
Console.WriteLine("who ever you are!");
else
for (int i=0;i<args.Length;i++)
Console.Write(" {0} ", args[i]);
return 0;
}
}
}
Let's examine the code a little deeper. First, notice that the code is enclosed within a namespace called HelloWorld
namespace HelloWorld
{
//...
}
The class name is Hello, therefore, the full name of the class that I have declared here is called HelloWorld.Hello, that is, the name is [NamespaceName].[ClassName].
Note
The fact ...
Read now
Unlock full access