Lecture Windows programming: Chapter 4 - Châu Thị Bảo Hà

Lecture Windows programming chapter 4 introduce about Object-Oriented Programming. This chapter have the contents as: Review concepts in OOP, write classes in C#, interface, inheritance, polymorphism, relationships between objects. | Object-Oriented Programming Chapter 4 Ebook: Beginning Visual C# 2010, part 1, chapter 8,9,10,13 Reference: DEITEL - CSharp How to Program Contents Review concepts in OOP Write classes in C# Interface Inheritance Polymorphism Relationships between objects Slide 2 Review concepts in OOP Basic concepts class object field method Other concepts (see later) Static members: field, property and method () Static constructor () Static class () ClassName - Fields + Methods Class diagram Slide 3 Contents Review concepts in OOP Write classes in C# Interface Inheritance Polymorphism Relationships between objects Slide 4 Create a class in C# Slide 5 Adding Members from a Class Diagram Create a class in C# Syntax: [access modifier]: private, public, protected, internal, protected internal If you do not declare base class, the base class default is the object [access modifier] class [: base_class] { // class body } Slide 6 By default, classes are declared as internal, meaning that only code in the current project will have access to them Member access modifiers private: can only be accessed from inside the class public: can be accessed from anywhere protected: can be accessed from inside the child class or any class in the same namespace internal (or none): default, only code in the current project will have access to them protected internal: are accessible only from code-derived classes within the project Slide 7 private : thành viên nào trong class được khai báo là private thì nó chỉ có thể được truy cập ở bên trong class đó. public : thành viên nào trong class được khai báo là public thì nó luôn luôn có thể được truy cập ở bất kỳ nơi nào trong chương trình. protected : thành viên nào được khai báo là protected thì nó chỉ có thể được truy cập ở bên trong class đó hoặc trong các class kế thừa nó. static: thành viên nào trong class được khai báo là static thì nó có thể được sử dụng kể cả khi không có khai báo đối tượng của lớp chứa thành viên đó. | Object-Oriented Programming Chapter 4 Ebook: Beginning Visual C# 2010, part 1, chapter 8,9,10,13 Reference: DEITEL - CSharp How to Program Contents Review concepts in OOP Write classes in C# Interface Inheritance Polymorphism Relationships between objects Slide 2 Review concepts in OOP Basic concepts class object field method Other concepts (see later) Static members: field, property and method () Static constructor () Static class () ClassName - Fields + Methods Class diagram Slide 3 Contents Review concepts in OOP Write classes in C# Interface Inheritance Polymorphism Relationships between objects Slide 4 Create a class in C# Slide 5 Adding Members from a Class Diagram Create a class in C# Syntax: [access modifier]: private, public, protected, internal, protected internal If you do not declare base class, the base class default is the object [access modifier] class [: base_class] { // class body } Slide 6 By default, classes are declared as .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
18    78    2    08-05-2024
Đã 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.