Feb 5, 2012

Introduction To Class Inheritance

This lesson teaches about C# Inheritance. Our objectives are as follows:
  • Implement Base Classes.
  • Implement Derived Classes.
  • Initialize Base Classes from Derived Classes.
  • Learn How to Call Base Class Members.
  • Learn How to Hide Base Class Members.

Introduction to Classes


This lesson introduces you to C# Classes. Our objectives are as follows:
  • Implement Constructors.
  • Know the difference between instance and static members.
  • Understand Destructors.
  • Familiarization with Class Members.


Introduction To Namespaces


This lesson introduces you to C# Namespaces.  Our objectives are as follows:
  • Understand what Namespace is.
  • Learn how to implement the using directive.
  • Learn to use alias directive.
  • Understand what are namespace members.

Introduction to Methods

In previous lessons of this tutorial, all of our functionality for each program resided in the Main() method. While this was adequate for the simple programs we used to learn earlier concepts, there is a better way to organize your program, using methods. A method helps you separate your code into modules that perform a given task. The objectives of this lesson are as follows:
  • Understand the structure of a method.
  • Know the difference between static and instance methods.
  • Learn to instantiate objects.
  • Learn how to call methods of an instantiated object.
  • Understand the 4 types of parameters.
  • Learn how to use the this reference.

Control Statements - Loops


In the last lesson, you learned how to create a simple loop by using the goto statement. I advised you that this is not the best way to perform loops in C#. The information in this lesson will teach you the proper way to execute iterative logic with the various C# looping statements. Its goal is to meet the following objectives:
  • Learn the while loop.
  • Learn the do loop.
  • Learn the for loop.
  • Learn the foreach loop.
  • Complete your knowledge of the break statement.
  • Teach you how to use the continue statement.


Control Statements - Selection



In the last couple of lessons, every program you saw contained a limited amount of sequential steps and then stopped. There were no decisions you could make with the input and the only constraint was to follow straight through to the end. The information in this lesson will help you branch into separate logical sequences based on decisions you make. More specifically, the goals of this lesson are as follows:
  • Learn the if statements.
  • Learn the switch statement.
  • Learn how break is used in switch statements.
  • Understand proper use of the goto statement.


Operators, Types, and Variables

This lesson introduces C# operators, types, and variables. Its goal is to meet the following objectives:
  •         Understand what a variable is.
  •        Familiarization with C# built-in types.
  •        Get an introduction to C# operators.
  •         Learn how to use Arrays.

Several versions of a Hello World program in C#.

Tutorial
The following examples show different ways of writing the C# Hello World program.

Example 1

// Hello1.cs
public class Hello1
{
   public static void Main()
   {
      System.Console.WriteLine("Hello, World!");
   }
}

Search for