TAILIEUCHUNG - C Language Reference Manual_7

Thành viên có chứa mã thực thi chung được gọi là các thành viên chức năng của lớp. Các thành viên chức năng của một lớp các phương pháp, tài sản, indexers, các nhà khai thác, xây dựng, và hàm hủy của lớp. Một khai báo lớp tạo ra một không gian kê khai mới | Chapter 10 Classes Members that contain executable code are collectively known as the function members of the class. The function members of a class are the methods properties indexers operators constructors and destructors of the class. A class-declaration creates a new declaration space and the class-member-declarations immediately contained by the class-declaration introduce new members into this declaration space. The following rules apply to class-member-declarations Constructors and destructors must have the same name as the immediately enclosing class. All other members must have names that differ from the name of the immediately enclosing class. The name of a constant field property event or type must differ from the names of all other members declared in the same class. The name of a method must differ from the names of all other non-methods declared in the same class. In addition the signature of a method must differ from the signatures of all other methods declared in the same class. The signature of an indexer must differ from the signatures of all other indexers declared in the same class. The signature of an operator must differ from the signatures of all other operators declared in the same class. The inherited members of a class are specifically not part of the declaration space of a class. Thus a derived class is allowed to declare a member with the same name or signature as an inherited member which in effect hides the inherited member . Inheritance A class inherits the members of its direct base class. Inheritance means that a class implicitly contains all members of its direct base class except for the constructors and destructors of the base class. Some important aspects of inheritance are Inheritance is transitive. If C is derived from B and B is derived from A then C inherits the members declared in B as well as the members declared in A. A derived class extends its direct base class. A derived class can add new members

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.