1. A Beginners Hello World
public class HelloWorld
{
public static void Main()
{
System.Console.WriteLine("HELLO WORLD" );
}
}
2. Slightly improved version
using System;
public class HelloWorld
{
public static void Main()
{
Console.WriteLine("HELLO WORLD" );
}
}
3. Command Line Arguments
using System;
public class HelloWorld
{
public static void Main(string [] args)
{
Console.WriteLine(args[0 ]);
}
}
4. From Constructor
using System;
public class HelloWorld
{
public HelloWorld()
{
Console.WriteLine("HELLO WORLD" );
}
public static void Main()
{
HelloWorld hw = new HelloWorld();
}
}
5. More OO
using System;
public class HelloWorld
{
public void helloWorld()
{
Console.WriteLine("HELLO WORLD" );
}
public static void Main()
{
HelloWorld hw = new HelloWorld();
hw.HelloWorld();
}
}
6. From another class
using System;
public class HelloWorld
{
public static