As we have so many design patterns in java, like wise do we have any in c++.Or can we use the same sort of patterns in c++.
There are various patterns in the C language like star patterns, number patterns, and character patterns.
Design patterns are not inherently language specific, although some patterns are more useful in some languages than others.
For learning design patterns, you probably want Java or C#. Those languages tend to be used by people that consider design patterns as idiomatic ways of writing the language. i.e. people consider using many design patterns in Java or C# to be the “correct” way of writing C# or Java.
The original book on Design patterns (Design Patterns: Elements of Reusable Object-Oriented Software by the Gang of Four) predates Java. The examples in there are in C++ and Smalltalk.
Design patterns are applicable to many object-oriented programming languages; maybe it's just that in Java they are usually so ubiquitous that you need them to solve anything non-trivial.
However, some design patterns are solved by language features (you don't need to explicitly implement an Observer Pattern in C#, for example). Others aren't even applicable to Java, as they need multiple class inheritance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With