Welcome to Mansiikumarii/OOP, a practical deep dive into the world of Object-Oriented Programming (OOP) using C++!
This repository is a complete collection of examples demonstrating key OOP concepts — from the basics of classes and objects to advanced topics like inheritance, polymorphism, and templates.
Each .cpp file in this repository focuses on a specific OOP concept with simple, easy-to-understand code examples and corresponding executables (.exe).
| Category | Files Included | Description |
|---|---|---|
| 🧱 Basics of Classes & Objects | Objects.cpp, MultipleObjects.cpp, MethodInside.cpp, MethodOutside.cpp |
Learn how to define and use classes, methods, and objects. |
| 🏗️ Constructors | Constructor.cpp, ConstructorOverloading.cpp, DefaultConstructor.cpp, ParametrisedConstructor.cpp, ConstructorDefinedOutsideClass.cpp |
Understand constructors, overloading, and object initialization. |
| 🔒 Access Control & Friend Functions | AccessPrivate.cpp, FriendFunctions.cpp |
Learn about access specifiers (private, public, protected) and friend functions. |
| 🧬 Inheritance | Inheritance.cpp, InheritanceAccess.cpp, MultilevelInheritance.cpp, MultipleInheritance.cpp |
Explore code reuse, hierarchy, and different inheritance types. |
| 🧠 Polymorphism & Virtual Functions | Polymorphism.cpp, WithVirtualFunction.cpp, WithoutVirtualFunction.cpp, StaticDynamic.cpp |
Discover how runtime and compile-time polymorphism work. |
| 🧩 Templates | Templates.cpp |
Get started with generic programming using templates. |
| ⚙️ Miscellaneous Demos | Dynamic.exe, hero.cpp, intro.cpp |
Additional examples showcasing C++ flexibility and creativity. |
- Language: C++
- Compiler: g++ / MinGW / Visual Studio C++ Compiler
- Paradigm: Object-Oriented Programming
# Clone the repository
git clone https://github.com/Mansiikumarii/OOP.git
# Navigate to the folder
cd OOP
# Compile any example
g++ ConstructorOverloading.cpp -o ConstructorOverloading.exe
# Run the program
./ConstructorOverloading.exeYou can also open these files in Code::Blocks, Visual Studio, or Dev-C++, and run them directly.
By exploring this repository, you’ll gain a strong understanding of:
- Class and object design
- Data encapsulation and abstraction
- Inheritance hierarchy and access control
- Polymorphism and virtual functions
- Constructor and destructor behavior
- Template usage for generic programming
“Tell me and I forget. Teach me and I remember. Involve me and I learn.” — Benjamin Franklin
This repository is built to learn by doing — every concept is explained through working examples to make C++ OOP clear, fun, and practical.
💬 Passionate about C++ and exploring the beauty of object-oriented design.
Feel free to:
- 🌟 Star this repository
- 🐛 Open issues if you find bugs
- 🔧 Submit pull requests with improvements or new examples
Let’s learn and build together!
🚀 “Code is like humor. When you have to explain it, it’s bad — so let’s make code that speaks for itself!”