tailieunhanh - The C# Programming Language phần 4

và mô tả C # 1,0 ngôn ngữ, giao trong Visual Studio. NET 2002 và 2003. Phần II ", C # ," bao gồm các chương 19-23 và mô tả các tính năng chính mới của C # : generics, phương pháp vô danh, vòng lặp, và các loại phần. Phần III, "Phụ lục", mô tả các ý kiến tài liệu hướng dẫn và tóm tắt các từ vựng và cú pháp | Classes and Objects Member Description Constants The constant values associated with the class Fields The variables of the class Methods The computations and actions that can be performed by the class Properties The actions associated with reading and writing named properties of the class Indexers The actions associated with indexing instances of the class in the same way as an array Events The notifications that can be generated by the class Operators The conversions and expression operators supported by the class Constructors The actions required to initialize instances of the class or the class itself Destructors The actions to perform before instances of the class are permanently discarded Types The nested types declared by the class 1. Introduction Accessibility Each member of a class has an associated accessibility which controls the regions of program text that are able to access the member. There are five possible forms of accessibility. These are summarized in the following table. Accessibility Meaning public Access not limited protected Access limited to this class and classes derived from this class internal Access limited to this program protected internal Access limited to this program and classes derived from this class private Access limited to this class 19 1. Introduction 1. Introduction Base Classes A class declaration may specify a base class by following the class name with a colon and the name of the base class. Omitting a base class specification is the same as deriving from type object. In the following example the base class of Point3D is Point and the base class of Point is object public class Point public int x y public Point int x int y x y public class Point3D Point public int z public Point3D int x int y int z Point x y z A class inherits the members of its base class. Inheritance means that a class implicitly contains all members of its base class except for the constructors of the base class. A .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
22    147    2    25-11-2024