What is Singleton Class in Java | Singleton Design Pattern Part 1

preview_player
Показать описание
For code click here:

The singleton pattern is implemented by creating a class with a method that creates a new instance of the class if one does not exist.

If an instance already exists, it simply returns a reference to that object.

To make sure that the object cannot be instantiated any other way, the constructor is made private.

Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Follow on Facebook:

Subscribe to our other channel:
Telusko Hindi :

Subscribe to the channel and learn Programming in easy way.

Рекомендации по теме
Комментарии
Автор

thanks for clarifying singleton class. you are a genius. Respect!!! nobody explained it like you did here

misubgify
Автор

Nice explanation. Here I found that, Inside Abc class, "static Abc obj = new Abc();" is defaulted to a public statement, so, inside the main method, java will allow accessing directly static obj object. eg. "Abc obj1 = Abc.obj;", so getInstance() method is never needed to use. To fix this, we can mention like "private static Abc obj = new Abc();" and getInstance() method can be used now.

rjlifeandtech
Автор

It would so good if you gave it with a real life example.Syntax is easy to learn but the implementation in programming daily life problems is so important here.
But the video and the explanation is amazing.

khalidben
Автор

Firstly, it was hard for me to understand the concept of Singleton pattern even after watching 4-5 videos, but your one video was more clear and was able to understand within few minutes. Thanks for the good stuff!

shaistakhalid
Автор

Thanks, I wish I came straight to this post before searching around; you made this concept very easy to understand.

drunkmadala
Автор

That;s the reason i love navin reddy tutorials he will just make viewers master in the concept what he is teaching Great man u are really great ALIEN..

gandamraviteja
Автор

this is the most simple explanation of a singleton design pattern i ever came across, thanks a lot

luyandantabeni
Автор

I have completed the playlist, and this is the best explanation i have seen on singleton design pattern! Thanks a lot Naveen

shubhamchopra
Автор

Thanks man! I have to make one of these for a project I'm working on. This is exactly what I needed to see.

eihodge
Автор

Concise, straight to the point. Thanks for sharing your knowledge

youyoudada
Автор

simple and easy explanation...thank you so much sir for clearing my concept.

TheRajraj
Автор

Great video. Short and to the point. Good explanations.

buildappswithevan
Автор

Well done mate, amazingly you have explained this in just 5 mins for which I was seeing more than 20 mins videos. Good job 👍

nitinsinging
Автор

Best explanation have ever found... thank you:)

aparnaraj
Автор

Very nice explanation sir. Keep making this type of valuable video always.
Thanks a lot

dayanandswami
Автор

We can also remove the getInstace method and can directly call the object by writing (Abc obj1 = Abc.obj) in main method

bobybrahmam
Автор

Thanks. This is amazing explanation. Easy to understand!

derryyeh
Автор

Happy Teachers Day Sir. Learnt a lot from your videos. Thank you for sharing knowledge :)

priyeshbhagat
Автор

That was a perfect explanation. Thank you❤️

jithinmv
Автор

Thanks! The explanation was precise and easy to understand.

AshutoshKumar-kqvh