Hierarchy (Phân cấp)

Trong lập trình hướng đối tượng, phân cấp là cách tạo lớp mới từ các lớp đã được định nghĩa từ trước. Khái niệm phân cấp được phát minh năm 1967 cho ngôn ngữ Simula.

Các lớp mới, gọi là lớp con hay lớp dẫn xuất, thừa hưởng các thuộc tính và hành vi của các lớp nguồn gốc, được gọi là các lớp cha hay lớp cơ sở. Mục đích của việc này là để tái sử dụng [code] chương trình có sẵn mà không phải sửa đổi hoặc chỉ phải sửa ít.

By English

In object-oriented programming (OOP), inheritance is a way to establish Is-a relationships between objects. In classical inheritance where objects are defined by classes, classes can inherit attributes and behavior from pre-existing classes called base classes, superclasses, or parent classes. The resulting classes are known as derived classes, subclasses, or child classes. The relationships of classes through inheritance gives rise to a hierarchy. In prototype-based programming, objects can be defined directly from other objects without the need to define any classes, in which case this feature is called differential inheritance.

The inheritance concept was invented in 1968 for Simula. Inheritance is a property of Object Oriented Programs.

Like Doanh nhân số