Tutorial by Examples

Java Singleton Pattern To implement Singleton pattern, we have different approaches but all of them have following common concepts. Private constructor to restrict instantiation of the class from other classes. Private static variable of the same class that is the only instance of the class. P...
The observer pattern is a common pattern, which is widely used in many contexts. A real example can be taken from YouTube: When you like a channel and want to get all news and watch new videos from this channel, you have to subscribe to that channel. Then, whenever this channel publishes any news, y...

Page 1 of 1