Hello World!
This lesson acquaints you with the Hello World program and gives a basic introduction to C#
A simple Hello World Program
There are basic elements that all C# executable programs have, and that’s what we’ll concentrate on for this first lesson, starting off with a simple C# program.
Warning: C# is case-sensitive
Below is a very simple C# application.
It is a console application that
prints out the message "Hello, World!"
C#
// Namespace Declarationusing System;// Program start classclass HelloWorld{// Main begins program execution.static void Main(){// Write to consoleConsole.WriteLine("Hello, World!");}}
The program has four primary elements:
- a namespace declaration
- a class
- the
Main
method - a program