Chapter 2: C# Basics

Chapter 2
C# Basics
  • Basic Data Types
  • Classes
  • Namespaces
  • Interfaces
  • Managing Errors with Exceptions
  • Casting
  • Structures
  • Enumerations

Microsoft Visual C# .NET provides a rich environment for developing object-oriented applications and components using the C# programming language. Visual C# .NET leverages the Microsoft .NET Framework to provide a rich set of built-in types that you can use when building your own classes. A subset of these types can be used for interacting with other .NET languages. The .NET Framework also provides an extensive class library that you can use and extend with Visual C# .NET.

The basic types that you can create in C# include the following:

  • Classes  Define new types and methods for interacting with those types

  • Exceptions  Describe errors that occur in your classes

  • Interfaces  Group related methods together

  • Structures  Aggregate other types into a new type

  • Enumerations  Define a range of named values for a type

Each of these basic types is similar to types available in other languages. In many cases, C# includes additional features that make these language constructions more useful to the component or application developer.

Part III: Programming Windows Forms