Static class vs Singleton in C# | C# Interview Questions & Answers | Static & Singleton in CSharp

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ย. 2024

ความคิดเห็น • 55

  • @questpondvideos
    @questpondvideos  3 ปีที่แล้ว +2

    25+ OOPS Interview Questions : th-cam.com/video/u99wAoBjDvQ/w-d-xo.html
    30 Important C# Interview Questions : th-cam.com/video/BKynEBPqiIM/w-d-xo.html
    Software Architecture Interview Questions : th-cam.com/video/AtTgcbLOqMM/w-d-xo.html
    20+ SQL Server Interview Questions : th-cam.com/video/SEdAF8mSKS4/w-d-xo.html
    10+ Power BI Interview Questions : th-cam.com/video/Cozc9WNBRt4/w-d-xo.html
    20 MSBI Interview Questions : th-cam.com/video/Nw_sHEKnOUE/w-d-xo.html
    SQL Server Joins : th-cam.com/video/KTvYHEntvn8/w-d-xo.html
    SQL Step by Step - th-cam.com/video/uGlfP9o7kmY/w-d-xo.html
    Angular Step by Step Tutorial for Beginners : th-cam.com/video/-9VcW7MBDs8/w-d-xo.html
    25 Angular Interview Questions : th-cam.com/video/-jeoyDJDsSM/w-d-xo.html
    25 Important ASP.NET Interview Questions : th-cam.com/video/pXmMdmJUC0g/w-d-xo.html
    35 Important JavaScript Interview Questions : th-cam.com/video/Zb4dPi7CANU/w-d-xo.html
    20 MySQL Interview Questions : th-cam.com/video/9hfjC-BpY20/w-d-xo.html
    5 MSBI Interview Questions : th-cam.com/video/5E815aXAwYQ/w-d-xo.html
    20 PHP Interview Questions : th-cam.com/video/1bpNSynUrl8/w-d-xo.html

  • @gururajaraghavendrarao3362
    @gururajaraghavendrarao3362 3 ปีที่แล้ว +42

    Sir, I have 16 year of IT experience and working as an Enterprise Architect. I follow you from my early days. Your words and texts are really motivated and kept my level to update myself continuously. I take a moment to thank you sir. Royal salute to you. You are great and boom for many like me. 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

  • @sahiljain1760
    @sahiljain1760 3 ปีที่แล้ว +3

    By far the best video on this subject. Nobody explained it this way.

  • @questpondvideos
    @questpondvideos  4 ปีที่แล้ว +2

    If you liked this Session, Do share and email on questpond@questpond.com the Link for your FB, Twitter, and Linkedin and avail the discount price for the "Learn Design Pattern Step by Step" www.questpond.com/buynow.php?courseid=MTA=.

  • @mominwasae2225
    @mominwasae2225 3 ปีที่แล้ว

    To be fair most clear explanation...thanks shiv sir

  • @AruNilTRails
    @AruNilTRails 3 ปีที่แล้ว +3

    Sealed is used for Singleton to restrict the use of new keyword and object creation in a nested derived class. If some other class is getting inherited inside the singleton class then private constructor becomes accessible inside the nested derived class. Again you can write new keyword and that will violate the entire objective of creating single instance.

    • @srikantamohanty1815
      @srikantamohanty1815 3 ปีที่แล้ว

      Static class also sealed classes ...cant be inherited

    • @sachinbaliyan4845
      @sachinbaliyan4845 2 ปีที่แล้ว

      @@srikantamohanty1815 But that is the problem you cannot create an instance method in instance class and we cannot extend it on new requirement...

  • @Gauravkumar-jm4ve
    @Gauravkumar-jm4ve 2 ปีที่แล้ว

    Excellent explanation Sir thank u so much, pls keep posting more

  • @saiashok28
    @saiashok28 2 ปีที่แล้ว +1

    Very Impressive!

  • @pulapakadurgaprasad6141
    @pulapakadurgaprasad6141 2 ปีที่แล้ว

    After two years today also gurupournami... Today I watched

  • @vineetchaudhary7082
    @vineetchaudhary7082 4 ปีที่แล้ว

    Its very nice video to clear the basic funda.

  • @5minutecode3
    @5minutecode3 4 ปีที่แล้ว

    Thanks sir for such a detailed and informative session

  • @malayaliop2669
    @malayaliop2669 2 ปีที่แล้ว +1

    Sir,since class is having private constructor, that class is restricting instance creation and inheritance right.Then what is the purpose of sealed class

  • @eladyehuda8827
    @eladyehuda8827 6 หลายเดือนก่อน

    Regarding the safe iterator, what will happen even though you defined a property as Ienumable, if you cast the property to a list? You will then perform Add, in the original property the element that was added will appear like that? But like that, do you have an argument that explains that this is also avoided?

  • @marziehfatemi7615
    @marziehfatemi7615 2 ปีที่แล้ว

    I learned a lot . thank you

  • @vineetchaudhary7082
    @vineetchaudhary7082 4 ปีที่แล้ว +4

    I want to ask one Question: If we are going to use singleton design pattern in application then all request goes to, into a queue then performance will be down it means bottleneck will come. then why Singleton?

    • @GauravChaudhary09
      @GauravChaudhary09 3 ปีที่แล้ว +1

      Parallelism is different from concurrency. In single ofcourse performance will be less but data will be thread safe and you can still have another ways of improving performance.

  • @Koiw506
    @Koiw506 2 ปีที่แล้ว

    you are great sir 👏

  • @rajeevjha3714
    @rajeevjha3714 3 ปีที่แล้ว

    Best explanation

  • @JarvisAlgo
    @JarvisAlgo 3 ปีที่แล้ว +1

    Can we have one more video on TPL and TAL , means task vs async await… where when to use it

  • @melodysaga6076
    @melodysaga6076 4 ปีที่แล้ว

    next level teacher you are :) Bingo

  • @JarvisAlgo
    @JarvisAlgo 3 ปีที่แล้ว

    Nice discussion….

  • @rakeshranjan1425
    @rakeshranjan1425 3 ปีที่แล้ว

    very good lots of thanks

  • @rahmankusan4340
    @rahmankusan4340 2 ปีที่แล้ว

    s. Thank you In The setup❤️

  • @faeez4722
    @faeez4722 3 ปีที่แล้ว

    Love your videos

  • @srikantamohanty1815
    @srikantamohanty1815 3 ปีที่แล้ว

    Nice explanation

  • @bishwaitsahoo9443
    @bishwaitsahoo9443 3 ปีที่แล้ว

    Its dependes on the what type ofrequirement we have, if we are going to use Singleton, then why we are going to inherit it or any object oriented features. for an instance : the Singleton can be used if any master data(readonly) we need to used through out the application

  • @umamaheswari8805
    @umamaheswari8805 3 ปีที่แล้ว

    👌👌👌Thank you sir 🙏

  • @satriafitasa4740
    @satriafitasa4740 2 ปีที่แล้ว

    Try zooming in (ctrl+scroll)

  • @aagebadho6907
    @aagebadho6907 3 ปีที่แล้ว +1

    @Questpond
    If you are changing the data type of GetCountries from List to IEnumberable and saying that now we don't get methods like Add() which can manipulate the data. I assume that assumption is wrong, why because anytime we can type cast the IEnumberable type to List type again. And once that is done then we again have access to GetCountries() which can manipulate the data. Please help me explain this.

    • @Moosa_Says
      @Moosa_Says 2 ปีที่แล้ว

      .ToList() will give you a new list.

  • @niteshhebbare697
    @niteshhebbare697 2 ปีที่แล้ว

    Thanks sir

  • @milindjaid9968
    @milindjaid9968 4 ปีที่แล้ว

    Great explanation

    • @questpondvideos
      @questpondvideos  4 ปีที่แล้ว

      👊👊👊👊👊👊Smash the Subscribe button if you like it.👊👊👊👊👊👊

  • @chetslove03
    @chetslove03 4 ปีที่แล้ว +1

    Thanks a lot...It was great session...

    • @questpondvideos
      @questpondvideos  4 ปีที่แล้ว

      👊👊👊👊👊👊Smash the Subscribe button if you like it.👊👊👊👊👊👊

  • @hearyourmood9633
    @hearyourmood9633 2 ปีที่แล้ว

    Why can't i encapsulate countries list in static class? I could make list private and create a public method for getting that list

  • @sayanchatterjee5085
    @sayanchatterjee5085 3 ปีที่แล้ว +1

    Hi, Why you did not create a private constructor for your "Singleton" class?

  • @jaleelahmed1000
    @jaleelahmed1000 2 ปีที่แล้ว

    hi sir

  • @hlch7774
    @hlch7774 2 ปีที่แล้ว

    Singleton class is not a static class like your code, and your demonstration is only to show the difference between Singleton instance and naked static instance, not the difference between singleton class and static class

  • @srikantamohanty1815
    @srikantamohanty1815 3 ปีที่แล้ว

    Where to use singletone pattern

  • @SANJAYGHOSH-qg8tg
    @SANJAYGHOSH-qg8tg 5 หลายเดือนก่อน

    😀

  • @BimalDaslol
    @BimalDaslol 2 ปีที่แล้ว

    Why your singleton class has static keyword? As far I know Singleton class can not have static keyword.

  • @bsbs1927
    @bsbs1927 4 ปีที่แล้ว +4

    Static cannot be inheited

  • @t555d
    @t555d 3 ปีที่แล้ว +1

    Wikipedia is not credible source for such things.

    • @questpondvideos
      @questpondvideos  3 ปีที่แล้ว +2

      Its still a source where people have put lot of effort.

    • @suraj8092
      @suraj8092 2 ปีที่แล้ว

      Wikipedia is a decent source for information except for history, politics, and religion.

  • @ManuliBiswal
    @ManuliBiswal ปีที่แล้ว

    🐅👨‍👩‍👦

  • @nandeshwarbagde2494
    @nandeshwarbagde2494 ปีที่แล้ว +1

    Why many videos paid? Please make it free so that the needy people can get knowledge. Knowledge sharing is biggest knowledge earning. If you consider yourself as a teacher, please don't make paid videos as I can't afford it, it should be free and if I feel may donate you money or donate blessings 😉

    • @jagdishdinkar2325
      @jagdishdinkar2325 ปีที่แล้ว +1

      So You are a beggar who can not afford 20$. Cheap and Greedy indians. These indians are blood leechers. They do not understand teacher has family. Selfish

    • @questpondvideos
      @questpondvideos  ปีที่แล้ว +3

      So sad comment what can i say. We also have families.