From 4fb3a79570f949171d22a7fdc871d81bc4477f05 Mon Sep 17 00:00:00 2001 From: Dharmin Nagar <68629743+dharminnagar@users.noreply.github.com> Date: Sat, 1 Nov 2025 18:11:04 +0530 Subject: [PATCH] fix: typo in inheritance section Corrected a typo in the word 'overall' and improved clarity. --- C++ Syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C++ Syntax.md b/C++ Syntax.md index 00bc500..3b3c74b 100644 --- a/C++ Syntax.md +++ b/C++ Syntax.md @@ -176,7 +176,7 @@ Another important consideration: If you have getters and setters for all of your ### 1.2 Inheritance A class can extend another class, meaning that the new class inherits all of the data from the other class, and can also override its methods, add new members, etc. Inheritance is the key feature required for [polymorphism](#13-class-polymorphism). -It is important to note that this feature is often overused by beginners and sometimes unnecessary hierarchies are created, adding to the overally complexity. There are some good alternatives such as [composition](https://en.wikipedia.org/wiki/Composition_over_inheritance) and [aggregation](https://stackoverflow.com/a/269535), although, of course, sometimes inheritance is exactly what is needed. +It is important to note that this feature is often overused by beginners and sometimes unnecessary hierarchies are created, adding to the overall complexity. There are some good alternatives such as [composition](https://en.wikipedia.org/wiki/Composition_over_inheritance) and [aggregation](https://stackoverflow.com/a/269535), although, of course, sometimes inheritance is exactly what is needed. **Example:** the class `Rectangle` can inherit from the class `Polygon`. You would then say that a `Rectangle` extends from a `Polygon`, or that class `Rectangle` is a sub-class of `Polygon`. In plain English, this means that a `Rectangle` is a more specialized version of a `Polygon`. Thus, all rectangles are polygons, but not all polygons are rectangles.