O'Reilly logo

Microsoft® Visual C#® 2008 Step by Step by John Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing Your First Program

The Program.cs file defines a class called Program that contains a method called Main. All methods must be defined inside a class. You will learn more about classes in Chapter 7, Chapter 7. The Main method is special—it designates the program's entry point. It must be a static method. (You will look at methods in detail in Chapter 3, Chapter 3, and I discuss static methods in Chapter 7.)

Note

Important C# is a case-sensitive language. You must spell Main with a capital M.

In the following exercises, you'll write the code to display the message Hello World in the console; you'll build and run your Hello World console application; and you'll learn how namespaces are used to partition code elements.

Write the code by using ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required