Книга: C# 2008 Programmer

Defining a Class

Defining a Class

You use the class keyword to define a class. The following example is the definition of a class called Contact:

public class Contact {
 public int ID;
 public string FirstName;
 public string LastName;
 public string Email;
}

This Contact class has four public members — ID, FirstName, LastName, and Email. The syntax of a class definition is:

<access_modifiers> class Class_Name{

 //---Fields, properties, methods, and events---

}

Оглавление книги


Генерация: 0.972. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз