tailieunhanh - Chapter 8 Inheritance

Inheritance is the practice of passing on property, titles, debts, rights and obligations upon the death of an individual. It represents also to pass a characteristic, genetically. It has long played an important role in human societies. The rules of inheritance differ between societies and have changed over time. | Chapter 8 Inheritance © 2004 Pearson Addison-Wesley. All rights reserved 8- Inheritance Inheritance is a fundamental object-oriented design technique used to create and organize reusable classes Chapter 8 focuses on: deriving new classes from existing classes the protected modifier creating class hierarchies abstract classes indirect visibility of inherited members designing for inheritance © 2004 Pearson Addison-Wesley. All rights reserved 8- Outline Creating Subclasses Overriding Methods Class Hierarchies Inheritance and Visibility Designing for Inheritance © 2004 Pearson Addison-Wesley. All rights reserved 8- Inheritance Inheritance allows a software developer to derive a new class from an existing one The existing class is called the parent class, or superclass, or base class The derived class is called the child class or subclass As the name implies, the child inherits characteristics of the parent That is, the child class inherits the methods and data defined by the | Chapter 8 Inheritance © 2004 Pearson Addison-Wesley. All rights reserved 8- Inheritance Inheritance is a fundamental object-oriented design technique used to create and organize reusable classes Chapter 8 focuses on: deriving new classes from existing classes the protected modifier creating class hierarchies abstract classes indirect visibility of inherited members designing for inheritance © 2004 Pearson Addison-Wesley. All rights reserved 8- Outline Creating Subclasses Overriding Methods Class Hierarchies Inheritance and Visibility Designing for Inheritance © 2004 Pearson Addison-Wesley. All rights reserved 8- Inheritance Inheritance allows a software developer to derive a new class from an existing one The existing class is called the parent class, or superclass, or base class The derived class is called the child class or subclass As the name implies, the child inherits characteristics of the parent That is, the child class inherits the methods and data defined by the parent class © 2004 Pearson Addison-Wesley. All rights reserved 8- Inheritance Inheritance relationships are shown in a UML class diagram using a solid arrow with an unfilled triangular arrowhead pointing to the parent class Vehicle Car Proper inheritance creates an is-a relationship, meaning the child is a more specific version of the parent © 2004 Pearson Addison-Wesley. All rights reserved 8- Inheritance A programmer can tailor a derived class as needed by adding new variables or methods, or by modifying the inherited ones Software reuse is a fundamental benefit of inheritance By using existing software components to create new ones, we capitalize on all the effort that went into the design, implementation, and testing of the existing software © 2004 Pearson Addison-Wesley. All rights reserved 8- Deriving Subclasses In Java, we use the reserved word extends to establish an inheritance relationship See (page 440) See (page 441) See .

TÀI LIỆU LIÊN QUAN
TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.