From 254b9fd645803a208ba0ac03357b02c1543b87dd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 09:31:55 +0000 Subject: [PATCH 1/4] Initial plan From d848ea325e6ba88bb47b00329d89d00ca77b32f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 09:40:44 +0000 Subject: [PATCH 2/4] Fix inconsistent header hierarchy in Advanced Concepts section Co-authored-by: M-F-Tushar <171763969+M-F-Tushar@users.noreply.github.com> --- Cheat sheet/Readme.md | 72 +++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/Cheat sheet/Readme.md b/Cheat sheet/Readme.md index 74618c8..316fc27 100644 --- a/Cheat sheet/Readme.md +++ b/Cheat sheet/Readme.md @@ -3998,9 +3998,9 @@ class Child extends Parent { **C++ vs Java Difference:** C++ static_cast is compile-time only, no runtime checks. Java casting includes runtime type checking. C++ has multiple cast operators; Java has one cast syntax with automatic checking. Java is safer; C++ offers more control. --- -# C++ and Java Advance Concept +# C++ and Java Advanced Concepts -## 1. Run-Time Type Identification (RTTI) +### 1. Run-Time Type Identification (RTTI) **Definition:** A mechanism that allows the type of an object to be determined during program execution. @@ -4039,7 +4039,7 @@ public class Main { --- -## 2. typeid Operator +### 2. typeid Operator **Definition:** A C++ operator that returns type information about an expression. @@ -4077,7 +4077,7 @@ public class Main { --- -## 3. dynamic_cast +### 3. dynamic_cast **Definition:** A C++ casting operator that performs safe downcasting with runtime type checking. @@ -4122,7 +4122,7 @@ public class Main { --- -## 4. const_cast +### 4. const_cast **Definition:** A C++ casting operator that adds or removes const or volatile qualifiers. @@ -4163,7 +4163,7 @@ public class Main { --- -## 5. static_cast +### 5. static_cast **Definition:** A C++ casting operator that performs compile-time type conversions. @@ -4198,7 +4198,7 @@ public class Main { --- -## 6. reinterpret_cast +### 6. reinterpret_cast **Definition:** A C++ casting operator that performs low-level reinterpretation of bit patterns. @@ -4239,7 +4239,7 @@ public class Main { --- -## 7. Upcasting (Implicit) +### 7. Upcasting (Implicit) **Definition:** Converting a derived class reference/pointer to a base class reference/pointer. @@ -4279,7 +4279,7 @@ public class Main { --- -## 8. Downcasting (Explicit) +### 8. Downcasting (Explicit) **Definition:** Converting a base class reference/pointer to a derived class reference/pointer. @@ -4321,7 +4321,7 @@ public class Main { --- -## 9. instanceof Operator +### 9. instanceof Operator **Definition:** A Java operator that tests whether an object is an instance of a specific class or interface. @@ -4365,7 +4365,7 @@ public class Main { --- -## 10. type_info Object +### 10. type_info Object **Definition:** A C++ class that holds implementation-specific information about a type. @@ -4407,7 +4407,7 @@ public class Main { --- -## 11. Templates and Generics +### 11. Templates and Generics **Definition:** Mechanisms for writing code that works with any data type without sacrificing type safety. @@ -4448,7 +4448,7 @@ public class Main { --- -## 12. Generic Function (Template) +### 12. Generic Function (Template) **Definition:** A function that can operate on different data types specified as parameters. @@ -4495,7 +4495,7 @@ public class Main { --- -## 13. Generic Class (Template Class) +### 13. Generic Class (Template Class) **Definition:** A class that can work with any data type specified as a type parameter. @@ -4551,7 +4551,7 @@ public class Main { --- -## 14. Namespace +### 14. Namespace **Definition:** A declarative region that provides scope to identifiers to prevent name conflicts. @@ -4593,7 +4593,7 @@ class MathUtils { --- -## 15. using Statement +### 15. using Statement **Definition:** A C++ statement that introduces names from a namespace into the current scope. @@ -4627,7 +4627,7 @@ public class Main { --- -## 16. Formal Generic Type +### 16. Formal Generic Type **Definition:** The type parameter declared in a generic class or method definition. @@ -4681,7 +4681,7 @@ public class Main { --- -## 17. Wildcard Generic Type +### 17. Wildcard Generic Type **Definition:** A special generic type parameter in Java that represents an unknown type. @@ -4736,7 +4736,7 @@ public class Main { --- -## 18. Template Instantiation +### 18. Template Instantiation **Definition:** The process of generating concrete code from a template by substituting type parameters with actual types. @@ -4789,7 +4789,7 @@ public class Main { --- -## 19. Standard Template Library (STL) +### 19. Standard Template Library (STL) **Definition:** A C++ library providing generic container classes, algorithms, and iterators. @@ -4832,7 +4832,7 @@ public class Main { --- -## 20. STL Containers +### 20. STL Containers **Definition:** Template classes in STL that store collections of objects. @@ -4875,7 +4875,7 @@ public class Main { --- -## 21. Algorithms +### 21. Algorithms **Definition:** Template functions in STL that perform operations on containers. @@ -4923,7 +4923,7 @@ public class Main { --- -## 22. Iterators +### 22. Iterators **Definition:** Objects that allow traversal through container elements. @@ -4967,7 +4967,7 @@ public class Main { --- -## 23. vector +### 23. vector **Definition:** A dynamic array container that can grow or shrink in size. @@ -5012,7 +5012,7 @@ public class Main { --- -## 24. list +### 24. list **Definition:** A doubly-linked list container. @@ -5059,7 +5059,7 @@ public class Main { --- -## 25. queue +### 25. queue **Definition:** A FIFO (First-In-First-Out) container adapter. @@ -5106,7 +5106,7 @@ public class Main { --- -## 26. stack +### 26. stack **Definition:** A LIFO (Last-In-First-Out) container adapter. @@ -5153,7 +5153,7 @@ public class Main { --- -## 27. map +### 27. map **Definition:** An associative container that stores key-value pairs with unique keys. @@ -5196,7 +5196,7 @@ public class Main { --- -## 28. Random-access Iterator +### 28. Random-access Iterator **Definition:** An iterator that provides random access to elements with constant time complexity. @@ -5240,7 +5240,7 @@ public class Main { --- -## 29. Bidirectional Iterator +### 29. Bidirectional Iterator **Definition:** An iterator that can move both forward and backward through elements. @@ -5283,7 +5283,7 @@ public class Main { --- -## 30. Forward Iterator +### 30. Forward Iterator **Definition:** An iterator that can only move forward through elements. @@ -5326,7 +5326,7 @@ public class Main { --- -## 31. Input Iterator +### 31. Input Iterator **Definition:** An iterator that can read elements sequentially in a single pass. @@ -5374,7 +5374,7 @@ public class Main { --- -## 32. Output Iterator +### 32. Output Iterator **Definition:** An iterator that can write elements sequentially in a single pass. @@ -5421,7 +5421,7 @@ public class Main { --- -## 33. size_type +### 33. size_type **Definition:** An unsigned integer type representing the size of a container. @@ -5469,7 +5469,7 @@ public class Main { --- -## 34. iterator Type +### 34. iterator Type **Definition:** A typedef representing the iterator type for a container. @@ -5514,7 +5514,7 @@ public class Main { --- -## 35. value_type +### 35. value_type **Definition:** A typedef representing the type of elements stored in a container. From ca48420aaeb86e9f8321e80b08d73b0d5dad82d2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 09:45:31 +0000 Subject: [PATCH 3/4] Unify document structure with consistent header hierarchy Co-authored-by: M-F-Tushar <171763969+M-F-Tushar@users.noreply.github.com> --- Cheat sheet/Readme.md | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Cheat sheet/Readme.md b/Cheat sheet/Readme.md index 316fc27..fb9eb81 100644 --- a/Cheat sheet/Readme.md +++ b/Cheat sheet/Readme.md @@ -1,5 +1,20 @@ # Complete OOP Concepts Reference Guide +## Table of Contents + +1. [Fundamental Structure and Lifetime](#fundamental-structure-and-lifetime) +2. [Access Control and Inheritance](#access-control-and-inheritance) +3. [Polymorphism and Virtual Functions](#polymorphism-and-virtual-functions) +4. [Friends and Operators](#friends-and-operators) +5. [Memory and Pointers](#memory-and-pointers) +6. [Special Functions and Modifiers](#special-functions-and-modifiers) +7. [C++ and Java Advanced Concepts](#c-and-java-advanced-concepts) +8. [Exception Handling](#exception-handling) +9. [Interfaces and Abstract Classes](#interfaces-and-abstract-classes) +10. [Relationships and Design](#relationships-and-design) +11. [Object Methods and Utilities](#object-methods-and-utilities) +12. [Advanced Features](#advanced-features) + --- ## Fundamental Structure and Lifetime @@ -3998,7 +4013,7 @@ class Child extends Parent { **C++ vs Java Difference:** C++ static_cast is compile-time only, no runtime checks. Java casting includes runtime type checking. C++ has multiple cast operators; Java has one cast syntax with automatic checking. Java is safer; C++ offers more control. --- -# C++ and Java Advanced Concepts +## C++ and Java Advanced Concepts ### 1. Run-Time Type Identification (RTTI) @@ -5559,9 +5574,7 @@ public class Main { **Differences:** C++ containers define `value_type` typedef for element type. Java uses the generic type parameter directly (no separate typedef). Both achieve type safety but with different mechanisms. -# Object-Oriented Programming Concepts Guide - -## Exception Handling +## Object-Oriented Programming Concepts Guide ### Exception Handling @@ -5876,7 +5889,7 @@ public class CustomException extends Throwable { --- -## Interfaces and Abstract Classes +### Interfaces and Abstract Classes ### Interface @@ -6219,7 +6232,7 @@ class Car extends Vehicle { --- -## Relationships and Design +### Relationships and Design ### Encapsulation @@ -6753,9 +6766,9 @@ This comprehensive guide covers essential OOP concepts including exception handl - Relationships (association, aggregation, composition) model real-world interactions between objects - Both C++ and Java support core OOP concepts with syntax and semantic variations -# Object-Oriented Programming Concepts Reference +## Object-Oriented Programming Concepts Reference -## Object Methods and Utilities +### Object Methods and Utilities ### equals Method @@ -7124,7 +7137,7 @@ int sum = a + b; // both autounboxed for addition --- -## Advanced Features +### Advanced Features ### Inner Class From 0001ab73b29bcafe0a27d10c13ea3106aab3f63c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 09:48:09 +0000 Subject: [PATCH 4/4] Complete formatting improvements: update TOC and Summary headers Co-authored-by: M-F-Tushar <171763969+M-F-Tushar@users.noreply.github.com> --- Cheat sheet/Readme.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Cheat sheet/Readme.md b/Cheat sheet/Readme.md index fb9eb81..1f4b0b7 100644 --- a/Cheat sheet/Readme.md +++ b/Cheat sheet/Readme.md @@ -9,11 +9,13 @@ 5. [Memory and Pointers](#memory-and-pointers) 6. [Special Functions and Modifiers](#special-functions-and-modifiers) 7. [C++ and Java Advanced Concepts](#c-and-java-advanced-concepts) -8. [Exception Handling](#exception-handling) -9. [Interfaces and Abstract Classes](#interfaces-and-abstract-classes) -10. [Relationships and Design](#relationships-and-design) -11. [Object Methods and Utilities](#object-methods-and-utilities) -12. [Advanced Features](#advanced-features) +8. [Object-Oriented Programming Concepts Guide](#object-oriented-programming-concepts-guide) + - [Exception Handling](#exception-handling) + - [Interfaces and Abstract Classes](#interfaces-and-abstract-classes) + - [Relationships and Design](#relationships-and-design) +9. [Object-Oriented Programming Concepts Reference](#object-oriented-programming-concepts-reference) + - [Object Methods and Utilities](#object-methods-and-utilities) + - [Advanced Features](#advanced-features) --- @@ -6755,7 +6757,7 @@ class Stack { --- -## Summary +## Summary: Object-Oriented Programming Concepts Guide This comprehensive guide covers essential OOP concepts including exception handling mechanisms, interface design patterns, and fundamental object-oriented design principles. The examples demonstrate how these concepts are implemented in both C++ and Java, highlighting similarities and key differences between the languages. @@ -7896,7 +7898,7 @@ Container personContainer = new Container<>(new Person("Alice", 30)); --- -## Summary +## Summary: Complete OOP Concepts Reference This reference guide covers essential object-oriented programming concepts used in both C++ and Java. Key differences between the languages include: