TAILIEUCHUNG - C# language refference_9

the underlying TextWriter for the output device is created. But if the application makes no reference to the In and Error properties, then no objects are created for those devices. Virtual, override, and ab stract accessors Provided a property is not static, a property declaration may include a virtual modifier or an abstract modifier on either or both of its accessors. There is no requirement that the modifiers be the same for each accessor | Chapter 10 Classes public static Textwriter Error get if error null error new StreamWriter return error The Console class contains three properties In Out and Error that represent the standard input output and error devices. By exposing these members as properties the Console class can delay their initialization until they are actually used. For example upon first referencing the Out property as in Hello world the underlying TextWriter for the output device is created. But if the application makes no reference to the In and Error properties then no objects are created for those devices. Virtual override and abstract accessors Provided a property is not static a property declaration may include a virtual modifier or an abstract modifier on either or both of its accessors. There is no requirement that the modifiers be the same for each accessor. For example it is possible for a property to have a non-virtual get accessor and a virtual set accessor. The virtual accessors of an inherited property can be overridden in a derived class by including a property declaration that specifies override directives on its accessors. This is known as an overriding property declaration. An overriding property declaration does not declare a new property. Instead it simply specializes the implementations of the virtual accessors of an existing property. It is an error to mix override and non-override accessors in a property declaration. If a property declaration includes both accessors then both must include an override directive or both must omit it. An overriding property declaration must specify the exact same access modifiers type and name as the inherited property and it can override only those inherited accessors that are virtual. For example if an inherited property has a non-virtual get accessor and a virtual set accessor then an overriding property declaration can only include an override set accessor. When both accessors of

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.