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

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

Telusko

9 лет назад

417,051 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@jk-sm6qr
@jk-sm6qr - 29.12.2023 20:59

Thanks

Ответить
@mannmerwana476
@mannmerwana476 - 03.11.2023 19:58

I awe you respect Sir,Can't thank you enough.🙏🏻
I never understood why do we use a private constructor in a singleton class ,when jvm has automatically a default public constructor defined.
Got the answer,: To make it private and not allow clients to make objs with default constructor which is public by default,i.e to simple restrict the user from creating instance of the class .
Greatful to you.🙏🏻🫡🙏🏻❣️💯

Ответить
@samartajshaikh2601
@samartajshaikh2601 - 16.10.2023 02:13

Thanks for explaining this topic so simply.

Ответить
@TarekFaham
@TarekFaham - 18.04.2023 11:45

And, if the singleton needs to call a web service to fetch some values, where do you place the code? Do you place it inside the singleton class or outside?

Ответить
@abdullak8952
@abdullak8952 - 13.03.2023 17:10

lot of videos in java. why not in python?

Ответить
@bobybrahmam8653
@bobybrahmam8653 - 19.02.2023 19:44

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

Ответить
@MuazAtik
@MuazAtik - 14.12.2022 20:33

Amazing 🙏🙏🙏

Ответить
@abvy25
@abvy25 - 29.11.2022 16:31

Concise as always!

Ответить
@dollytiwari9707
@dollytiwari9707 - 19.10.2022 06:27

you are amazing sir.

Ответить
@eliaspianomusic
@eliaspianomusic - 18.10.2022 12:40

thx!

Ответить
@manickam7231
@manickam7231 - 21.09.2022 08:34

Bro y cant we use static class abc
Insted of declaring an static abc object

Ответить
@gandamraviteja7019
@gandamraviteja7019 - 14.09.2022 12:00

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..

Ответить
@drunkmadala
@drunkmadala - 27.08.2022 03:56

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

Ответить
@dayanandswami8109
@dayanandswami8109 - 20.08.2022 21:44

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

Ответить
@buildappswithevan1015
@buildappswithevan1015 - 01.08.2022 01:04

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

Ответить
@codethrusharing8955
@codethrusharing8955 - 14.06.2022 18:33

excellent tutorial, thank you so much, easy to understand!

Ответить
@onerifat
@onerifat - 24.05.2022 17:58

nice and clear explanation

Ответить
@uskapyaar8852
@uskapyaar8852 - 22.05.2022 15:56

Either i am stupid or something is wrong here ! how on earth he is able to create a method (getInstance) without mentioning the return type ? I mean i am not able to do that my IDE shows error

Ответить
@_HarshitSharma
@_HarshitSharma - 22.05.2022 11:39

Simple and Amazing explanation!

Ответить
@richardwilkins5241
@richardwilkins5241 - 21.05.2022 00:53

Great explanation

Ответить
@ankush9386
@ankush9386 - 04.05.2022 22:15

Thank you. Guys please like and share his videos. He really works hard. Thank you sir thank you so much.

Ответить
@samomamour8531
@samomamour8531 - 23.03.2022 14:22

Thank you a lot 💫

Ответить
@sankarachelliah2872
@sankarachelliah2872 - 18.02.2022 11:03

Hey! Is possible to pass arguments in singleton

Ответить
@derryyeh
@derryyeh - 24.01.2022 08:56

Thanks. This is amazing explanation. Easy to understand!

Ответить
@Acetul
@Acetul - 23.10.2021 21:33

Singleton grindset

Ответить
@manindersingh6371
@manindersingh6371 - 18.10.2021 22:17

Just adding some information here because I was facing the issue. We can create as many as instances inside the class because in the class we can access private constructor but we can't access it from outside the class.

Ответить
@kutilkol
@kutilkol - 18.10.2021 22:11

is this singleton tutorial or simpleton trying speak English

Ответить
@satya121prakash
@satya121prakash - 13.08.2021 23:57

Today I was asked this question in Java Back End Developer interview for Qualitest.

Ответить
@danielendless
@danielendless - 11.08.2021 17:38

Best explanation of this. Saved me a whole lot of trouble and inefficient alternatives

Ответить
@raghavbajaj5692
@raghavbajaj5692 - 10.08.2021 12:40

Why there is not setter but getter in singleton class

Ответить
@luyandantabeni2513
@luyandantabeni2513 - 17.07.2021 19:25

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

Ответить
@shaileshrkumar6813
@shaileshrkumar6813 - 08.06.2021 13:57

great video

Ответить
@aparnaraj3342
@aparnaraj3342 - 06.06.2021 17:41

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

Ответить
@sarathbaiju6040
@sarathbaiju6040 - 05.06.2021 09:53

i have a doubt, every time calling the getInstance() there is new instance of Abc class will create, so then how this approach follows singleton design pattern?

Ответить
@saifsms91
@saifsms91 - 01.06.2021 18:15

Nice Explanation of Singleton :)

Ответить
@janta42
@janta42 - 15.05.2021 09:01

Thanks Naveen! for making java interesting

Ответить
@priyaj5283
@priyaj5283 - 27.03.2021 18:52

Thankyou for thIs beautiful explanation.. could you also includes the implementation of such concepts in a project

Ответить
@VirajMavani
@VirajMavani - 23.03.2021 07:31

I agree with some of the comments here. The explanation is really good but an example would have helped a lot.

One example for Singleton use is simply Database connections. You don't want more than one instance throughout the application.

Ответить
@tijilparmar5758
@tijilparmar5758 - 11.02.2021 12:35

Thank you

Ответить
@DineshKumar-tn7pu
@DineshKumar-tn7pu - 07.02.2021 02:13

I have a question. We could have called the static variable in the other class main method, would have acted the same way as it is a static variable itself. Why we need a static method and call the static variable through the method?

Ответить
@nisithmondal7026
@nisithmondal7026 - 09.11.2020 18:58

best explanation about Singleton Class

Ответить
@poshettiakhil2664
@poshettiakhil2664 - 27.10.2020 21:43

Awesome explaination of single ton pattern

Ответить
@chathuramahasen
@chathuramahasen - 01.10.2020 14:13

Thanks, sir. This really helps to get a proper understanding of the basics!

Ответить
@eihodge
@eihodge - 01.10.2020 07:13

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

Ответить
@crisag.2698
@crisag.2698 - 03.09.2020 22:49

Do we need the private constructor? Will it work without it?

Ответить
@conventionalfusion6416
@conventionalfusion6416 - 16.08.2020 16:37

🇿🇦🇿🇦🇿🇦🇿🇦🇿🇦🇿🇦🇿🇦🇿🇦🇿🇦🇿🇦, which country is this from the flag??

Ответить
@adithya00
@adithya00 - 12.08.2020 01:29

link of the code doesn't work.

Ответить
@santoshs252
@santoshs252 - 10.08.2020 19:35

mana telugollu eppudaina thope ehe.

Ответить
@vs7281
@vs7281 - 04.08.2020 20:05

What if we pass parameters while creating instance of class

Ответить
@rajatvarshney2721
@rajatvarshney2721 - 12.06.2020 08:23

clear cut to the point explanation

Ответить