CSharp - Type Creation Class Definition

Introduction

A class is a kind of reference type.

The simplest possible class declaration is as follows:

class YourClassName
{
}

class can have the following modifiers

  • public
  • internal
  • abstract
  • sealed
  • static
  • unsafe
  • partial

A class can also have generic type parameters, a base class, and interfaces

Within the braces class can have the following class members:

  • methods
  • properties
  • indexers
  • events
  • fields
  • constructors,
  • overloaded operators
  • nested types
  • finalizer

Related Topics