Lesson 1: Getting Started With C#: A Simple C# Program
Lesson 1: Getting Started With C#: A Simple C# Program
Lesson 1: Getting Started With C#: A Simple C# Program
This lesson will get you started with C# by introducing a few very simple programs. Here are the
objectives of this lesson:
Understand the basic structure of a C# program.
Obtain a basic familiarization of what a “Namespace” is.
Obtain a basic understanding of what a Class is.
Learn what the Main method does.
Learn how to obtain command-line input.
Learn about console input/output (I/O).
A Simple C# 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. After reviewing the code in Listing 1-1, I’ll
explain the basic concepts that will follow for all C# programs we will write throughout this tutorial.
Please see Listing 1-1 to view this first program.
Warning: C# is case-sensitive.
Listing 1-1. A Simple Welcome Program: Welcome.cs
// Namespace Declaration
using System;