Lập trình Windows - Lập Trình C #- Lập Trình C Shap - Chương 3

Tham khảo tài liệu 'lập trình windows - lập trình c #- lập trình c shap - chương 3', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chương 3 Xây dựng lớp và giao diện Nội dung Lập trình hướng đối tượng là gì? Khai báo lớp Khai báo interface Constructor & destructor Thuộc tính (field) Method Inheritance Protected fields Overriding method Nội dung Polymorphism (Đa hình) Down cast – up cast Abstract class Sealed class, nested class Interface Overview “Everything is an object! At least, that is the view from inside the CLR and the C# programming language. This is no surprise, because C# is, after all, an object-oriented language. The objects that you create through class definitions in C# have all the same capabilities as the other predefined objects in the system ” Apress-Accelerated C# 2008 Object-oriented Programming (OOP) Kỹ thuật lập trình truyền thống ( procedural programming): all functionality is contained in a few modules of code (often just one) Khó thay thế cải tiến Kỹ thuật OOP : Sử dụng nhiều modules of code, mỗi module cung cấp 1 chức năng riêng và có thể được cô lập (isolated) hay thậm chí độc lập hoàn toàn với nhau. Dễ dàng sử dụng lại các module What is an Object? An object is a building block of an OOP application Objects in C# are created from types, just like the variables. The type of an object is known by a special name in OOP, its class. You can use class definitions to instantiate objects, which means creating a real, named instance of a class. Page 227 Begin C# aaaaaaaaa Cấu trúc của object Một object gồm có: Field Method Life Cycle of an Object Gồm 2 giai đoạn (two important stages): ➤ Construction: đối tượng cần được khởi tạo, và được thực thi bởi hàm constructor ➤ Destruction: khi đối tượng bị hủy bỏ, 1 số nhiệm vụ clean-up cần được thực thi để giải phóng bộ nhớ hàm destructor. Tạo lớp trong C# Khai báo lớp Nếu ko khai báo lớp cơ sở thì C# mặc định xem lớp cơ sở là object Lớp luôn là kiểu dữ liệu tham chiếu (reference type) trong C# [access . | Chương 3 Xây dựng lớp và giao diện Nội dung Lập trình hướng đối tượng là gì? Khai báo lớp Khai báo interface Constructor & destructor Thuộc tính (field) Method Inheritance Protected fields Overriding method Nội dung Polymorphism (Đa hình) Down cast – up cast Abstract class Sealed class, nested class Interface Overview “Everything is an object! At least, that is the view from inside the CLR and the C# programming language. This is no surprise, because C# is, after all, an object-oriented language. The objects that you create through class definitions in C# have all the same capabilities as the other predefined objects in the system ” Apress-Accelerated C# 2008 Object-oriented Programming (OOP) Kỹ thuật lập trình truyền thống ( procedural programming): all functionality is contained in a few modules of code (often just one) Khó thay thế cải tiến Kỹ thuật OOP : Sử dụng nhiều modules of code, mỗi module cung cấp 1 chức năng riêng và có .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.