You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Cheat sheet/Readme.md
+36-36Lines changed: 36 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3998,9 +3998,9 @@ class Child extends Parent {
3998
3998
**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.
3999
3999
4000
4000
---
4001
-
# C++ and Java Advance Concept
4001
+
# C++ and Java Advanced Concepts
4002
4002
4003
-
## 1. Run-Time Type Identification (RTTI)
4003
+
### 1. Run-Time Type Identification (RTTI)
4004
4004
4005
4005
**Definition:** A mechanism that allows the type of an object to be determined during program execution.
4006
4006
@@ -4039,7 +4039,7 @@ public class Main {
4039
4039
4040
4040
---
4041
4041
4042
-
## 2. typeid Operator
4042
+
### 2. typeid Operator
4043
4043
4044
4044
**Definition:** A C++ operator that returns type information about an expression.
4045
4045
@@ -4077,7 +4077,7 @@ public class Main {
4077
4077
4078
4078
---
4079
4079
4080
-
## 3. dynamic_cast
4080
+
### 3. dynamic_cast
4081
4081
4082
4082
**Definition:** A C++ casting operator that performs safe downcasting with runtime type checking.
4083
4083
@@ -4122,7 +4122,7 @@ public class Main {
4122
4122
4123
4123
---
4124
4124
4125
-
## 4. const_cast
4125
+
### 4. const_cast
4126
4126
4127
4127
**Definition:** A C++ casting operator that adds or removes const or volatile qualifiers.
4128
4128
@@ -4163,7 +4163,7 @@ public class Main {
4163
4163
4164
4164
---
4165
4165
4166
-
## 5. static_cast
4166
+
### 5. static_cast
4167
4167
4168
4168
**Definition:** A C++ casting operator that performs compile-time type conversions.
4169
4169
@@ -4198,7 +4198,7 @@ public class Main {
4198
4198
4199
4199
---
4200
4200
4201
-
## 6. reinterpret_cast
4201
+
### 6. reinterpret_cast
4202
4202
4203
4203
**Definition:** A C++ casting operator that performs low-level reinterpretation of bit patterns.
4204
4204
@@ -4239,7 +4239,7 @@ public class Main {
4239
4239
4240
4240
---
4241
4241
4242
-
## 7. Upcasting (Implicit)
4242
+
### 7. Upcasting (Implicit)
4243
4243
4244
4244
**Definition:** Converting a derived class reference/pointer to a base class reference/pointer.
4245
4245
@@ -4279,7 +4279,7 @@ public class Main {
4279
4279
4280
4280
---
4281
4281
4282
-
## 8. Downcasting (Explicit)
4282
+
### 8. Downcasting (Explicit)
4283
4283
4284
4284
**Definition:** Converting a base class reference/pointer to a derived class reference/pointer.
4285
4285
@@ -4321,7 +4321,7 @@ public class Main {
4321
4321
4322
4322
---
4323
4323
4324
-
## 9. instanceof Operator
4324
+
### 9. instanceof Operator
4325
4325
4326
4326
**Definition:** A Java operator that tests whether an object is an instance of a specific class or interface.
4327
4327
@@ -4365,7 +4365,7 @@ public class Main {
4365
4365
4366
4366
---
4367
4367
4368
-
## 10. type_info Object
4368
+
### 10. type_info Object
4369
4369
4370
4370
**Definition:** A C++ class that holds implementation-specific information about a type.
4371
4371
@@ -4407,7 +4407,7 @@ public class Main {
4407
4407
4408
4408
---
4409
4409
4410
-
## 11. Templates and Generics
4410
+
### 11. Templates and Generics
4411
4411
4412
4412
**Definition:** Mechanisms for writing code that works with any data type without sacrificing type safety.
4413
4413
@@ -4448,7 +4448,7 @@ public class Main {
4448
4448
4449
4449
---
4450
4450
4451
-
## 12. Generic Function (Template)
4451
+
### 12. Generic Function (Template)
4452
4452
4453
4453
**Definition:** A function that can operate on different data types specified as parameters.
4454
4454
@@ -4495,7 +4495,7 @@ public class Main {
4495
4495
4496
4496
---
4497
4497
4498
-
## 13. Generic Class (Template Class)
4498
+
### 13. Generic Class (Template Class)
4499
4499
4500
4500
**Definition:** A class that can work with any data type specified as a type parameter.
4501
4501
@@ -4551,7 +4551,7 @@ public class Main {
4551
4551
4552
4552
---
4553
4553
4554
-
## 14. Namespace
4554
+
### 14. Namespace
4555
4555
4556
4556
**Definition:** A declarative region that provides scope to identifiers to prevent name conflicts.
4557
4557
@@ -4593,7 +4593,7 @@ class MathUtils {
4593
4593
4594
4594
---
4595
4595
4596
-
## 15. using Statement
4596
+
### 15. using Statement
4597
4597
4598
4598
**Definition:** A C++ statement that introduces names from a namespace into the current scope.
4599
4599
@@ -4627,7 +4627,7 @@ public class Main {
4627
4627
4628
4628
---
4629
4629
4630
-
## 16. Formal Generic Type
4630
+
### 16. Formal Generic Type
4631
4631
4632
4632
**Definition:** The type parameter declared in a generic class or method definition.
4633
4633
@@ -4681,7 +4681,7 @@ public class Main {
4681
4681
4682
4682
---
4683
4683
4684
-
## 17. Wildcard Generic Type
4684
+
### 17. Wildcard Generic Type
4685
4685
4686
4686
**Definition:** A special generic type parameter in Java that represents an unknown type.
4687
4687
@@ -4736,7 +4736,7 @@ public class Main {
4736
4736
4737
4737
---
4738
4738
4739
-
## 18. Template Instantiation
4739
+
### 18. Template Instantiation
4740
4740
4741
4741
**Definition:** The process of generating concrete code from a template by substituting type parameters with actual types.
4742
4742
@@ -4789,7 +4789,7 @@ public class Main {
4789
4789
4790
4790
---
4791
4791
4792
-
## 19. Standard Template Library (STL)
4792
+
### 19. Standard Template Library (STL)
4793
4793
4794
4794
**Definition:** A C++ library providing generic container classes, algorithms, and iterators.
4795
4795
@@ -4832,7 +4832,7 @@ public class Main {
4832
4832
4833
4833
---
4834
4834
4835
-
## 20. STL Containers
4835
+
### 20. STL Containers
4836
4836
4837
4837
**Definition:** Template classes in STL that store collections of objects.
4838
4838
@@ -4875,7 +4875,7 @@ public class Main {
4875
4875
4876
4876
---
4877
4877
4878
-
## 21. Algorithms
4878
+
### 21. Algorithms
4879
4879
4880
4880
**Definition:** Template functions in STL that perform operations on containers.
4881
4881
@@ -4923,7 +4923,7 @@ public class Main {
4923
4923
4924
4924
---
4925
4925
4926
-
## 22. Iterators
4926
+
### 22. Iterators
4927
4927
4928
4928
**Definition:** Objects that allow traversal through container elements.
4929
4929
@@ -4967,7 +4967,7 @@ public class Main {
4967
4967
4968
4968
---
4969
4969
4970
-
## 23. vector
4970
+
### 23. vector
4971
4971
4972
4972
**Definition:** A dynamic array container that can grow or shrink in size.
4973
4973
@@ -5012,7 +5012,7 @@ public class Main {
5012
5012
5013
5013
---
5014
5014
5015
-
## 24. list
5015
+
### 24. list
5016
5016
5017
5017
**Definition:** A doubly-linked list container.
5018
5018
@@ -5059,7 +5059,7 @@ public class Main {
5059
5059
5060
5060
---
5061
5061
5062
-
## 25. queue
5062
+
### 25. queue
5063
5063
5064
5064
**Definition:** A FIFO (First-In-First-Out) container adapter.
5065
5065
@@ -5106,7 +5106,7 @@ public class Main {
5106
5106
5107
5107
---
5108
5108
5109
-
## 26. stack
5109
+
### 26. stack
5110
5110
5111
5111
**Definition:** A LIFO (Last-In-First-Out) container adapter.
5112
5112
@@ -5153,7 +5153,7 @@ public class Main {
5153
5153
5154
5154
---
5155
5155
5156
-
## 27. map
5156
+
### 27. map
5157
5157
5158
5158
**Definition:** An associative container that stores key-value pairs with unique keys.
5159
5159
@@ -5196,7 +5196,7 @@ public class Main {
5196
5196
5197
5197
---
5198
5198
5199
-
## 28. Random-access Iterator
5199
+
### 28. Random-access Iterator
5200
5200
5201
5201
**Definition:** An iterator that provides random access to elements with constant time complexity.
5202
5202
@@ -5240,7 +5240,7 @@ public class Main {
5240
5240
5241
5241
---
5242
5242
5243
-
## 29. Bidirectional Iterator
5243
+
### 29. Bidirectional Iterator
5244
5244
5245
5245
**Definition:** An iterator that can move both forward and backward through elements.
5246
5246
@@ -5283,7 +5283,7 @@ public class Main {
5283
5283
5284
5284
---
5285
5285
5286
-
## 30. Forward Iterator
5286
+
### 30. Forward Iterator
5287
5287
5288
5288
**Definition:** An iterator that can only move forward through elements.
5289
5289
@@ -5326,7 +5326,7 @@ public class Main {
5326
5326
5327
5327
---
5328
5328
5329
-
## 31. Input Iterator
5329
+
### 31. Input Iterator
5330
5330
5331
5331
**Definition:** An iterator that can read elements sequentially in a single pass.
5332
5332
@@ -5374,7 +5374,7 @@ public class Main {
5374
5374
5375
5375
---
5376
5376
5377
-
## 32. Output Iterator
5377
+
### 32. Output Iterator
5378
5378
5379
5379
**Definition:** An iterator that can write elements sequentially in a single pass.
5380
5380
@@ -5421,7 +5421,7 @@ public class Main {
5421
5421
5422
5422
---
5423
5423
5424
-
## 33. size_type
5424
+
### 33. size_type
5425
5425
5426
5426
**Definition:** An unsigned integer type representing the size of a container.
5427
5427
@@ -5469,7 +5469,7 @@ public class Main {
5469
5469
5470
5470
---
5471
5471
5472
-
## 34. iterator Type
5472
+
### 34. iterator Type
5473
5473
5474
5474
**Definition:** A typedef representing the iterator type for a container.
5475
5475
@@ -5514,7 +5514,7 @@ public class Main {
5514
5514
5515
5515
---
5516
5516
5517
-
## 35. value_type
5517
+
### 35. value_type
5518
5518
5519
5519
**Definition:** A typedef representing the type of elements stored in a container.
0 commit comments