In this video I talk about design patterns in general and the main focus is on the Singleton pattern. There is also an example of a program using the Singleton pattern.
Not threadsafe. The getInstance either needs to be synchronized, the instance could be instantiated in a static block, or, arguably most correctly, you can convert the class to an enum.
Nicely explained. Two more things : getInstance method should be synchronized. And clone method should be overridden.
ihbaruskrd 1 month ago
Not threadsafe. The getInstance either needs to be synchronized, the instance could be instantiated in a static block, or, arguably most correctly, you can convert the class to an enum.
theswirve 3 months ago
very nicely explained..well done!!
sanjuktapanda11 4 months ago
really useful, thank you , keep it updating with other design patterns with examples
FreeEducationSriLank 7 months ago
well done bugger
ripperchunk 8 months ago
wonderful explaination
elliotbeat 9 months ago
good job!
bdebarshi2006 9 months ago
Yup, pretty good. The example of one pop-up instead of many pop-ups is damn good.
SiliconOldStreet 9 months ago
good job dude!
natarajisna2 11 months ago