developmentor - a developer services company    C# Tutorial
  Modules

1. .NET Overview

We begin with a brief overview of the languages, libraries, servers, services, and tools that make up the Microsoft .NET initiative. We then focus on the .NET software development model: C# source code, compiler, intermediate language, and the Common Language Runtime execution engine.

Topic    Exercises    Quiz


2. Basics

This section covers the core C# features that will be used by almost every program: application entry point, simple types, variables, basic input and output, operators, arrays, control constructs, comments etc.

Topic    Exercises    Quiz


3. Class

A class is a key object-oriented programming concept and the primary unit of coding in C#. This section gives an introduction to classes with coverage of instance fields and methods, access control, and object creation.

Topic    Exercises    Quiz


4. Initialization

Initialization of variables is important for program correctness. C# provides excellent support for initialization through well defined default values, variable initializers, and instance constructors.

Topic    Exercises    Quiz


5. Static

Shared resources are implemented in C# using static fields and static methods. Here we discuss how to define static fields and methods and how to access static members. The three initialization options for static fields are presented: default values, static variable initializers, and static constructor.

Topic    Exercises    Quiz


6. Reference Types

Reference types are implemented as reference/object pairs. An object is created using the new operator and is subsequently accessed through a reference. Here we discuss a number of issues surrounding references: assignment, parameter, aggregation, array, null, memory management, and garbage collection.

Topic    Exercises    Quiz


7. Properties

Properties model the traits of an object or a class. For users, properties give clean and simple access syntax. For class designers, properties maintain encapsulation and allow the execution of validation code.

Topic    Exercises    Quiz


8. Indexers

Indexers allow a class to support array like indexing. Indexers can be useful whenever a class represents a collection of data elements. The elements are accessed with the same square bracket syntax used for an array.

Topic    Exercises    Quiz


9. Inheritance

Inheritance provides a powerful tool for object-oriented programmers to model their application domain. Here we discuss both the syntax and the meaning of inheritance including access levels, method hiding, method chaining, and construction.

Topic    Exercises    Quiz


10. Binding

This section covers many issues that arise in the presence of inheritance: type compatibility, type conversion, method binding, method overriding, and abstract methods. Included is a discussion of how to use dynamic binding to achieve polymorphic behavior.

Topic    Exercises    Quiz


11. Interface

An interface defines a contract which classes can agree to support. Here we discuss the details of defining and implementing interfaces, including how to write generic code against an interface, how to use inheritance with interfaces, and how to resolve any ambiguities that arise when implementing multiple interfaces.

Topic    Exercises    Quiz


12. Exceptions

This module describes the C# error notification mechanism of exceptions. We show how to generate an exception, how to handle an exception, control flow when an exception is thrown, services offered by the exception classes in the .NET Framework Class Library, and how to implement a custom exception type.

Topic    Exercises    Quiz


13. Namespace

Namespace provides the ability to group logically related types and to separate types with the same name into different scopes. In this section we present how to create a namespace, how to access a type defined inside a namespace, and how to apply the using keyword to obtain convenient shorthand access to namespace members.

Topic    Exercises    Quiz


14. Delegates and Events

A delegate serves as a proxy for a method. Invoking the delegate causes it to invoke the method it represents. The classic application for delegates comes from graphical user interface programming where controls such as buttons, trees, lists, etc. publish events to their subscribers. In this section we will examine how to define a delegate type, use a delegate to implement a callback, use composition to create a delegate with multiple targets, and apply the event keyword to impose well known access semantics on a delegate.

Topic    Exercises    Quiz


This material is excerpted from the Programming C# course offered by DevelopMentor.