Đây không phải là trường hợp. Cho dù các nhà thiết kế của những thay đổi lớp học có nguồn gốc phương pháp giao diện hoặc giữ nó giống như trong các lớp cơ sở, tên cơ sở là phương pháp ẩn mã khách hàng có nguồn gốc lớp. Đây là phương pháp lớp học có nguồn gốc từ đó được gọi là từ mã khách hàng. Mã khách hàng có thể sử dụng phương pháp cơ bản nếu muốn, | file Administrator General 20English 20Learning it2002-7-6 both functions perform similar operations. The objects of the operation are somewhat different but Simpo PDF Merge and Split Unregistered Version - http their general semantics meaning is the same. It is only natural that their interfaces be the same. C rules are silent on that. It is okay to overwrite a base function with the same interface but this is not mandatory. For whatever reason many C programmers believe that the interface must be the same. This is not the case. Whether the designer of the derived class changes the method interface or keeps it the same as in the base class the base method name is hidden from the derived class client code. It is the derived class method that is called from the client code. The client code can use the base method if desired but this requires the base class scope operator to give a command to the compiler and a visual cue to the human reader. Cylinder cyl1 cyl2 initialize data double length similar to Circle double diam 2 double vol not in Circle cout Circumference of first cylinder length endl cout Volume of the second cylinder vol endl cout Diameter of the first cylinder diam endl cout Side area of first cylinder getArea endl visual cue Pluses and Minuses of Inheritance and Composition Inheritance is a good abstraction tool. It explicitly stresses conceptual connections among classes when these connections exist. For example the commonality between classes Circle and Cylinder is best reflected in the program design by deriving class Cylinder from class Circle. This inheritance relationship is conspicuous in the Cylinder code. For the client programmer and for the maintainer there is no need to study the classes separately comparing the code of one class against that of another class trying to figure out whether these classes are similar. The use of .