ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Why can I not implement singleton design pattern using a static variable. if not then what are the disadvantages of it?

user-image
تم إضافة السؤال من قبل Rasik Bihari , Technical Lead , Grapecity
تاريخ النشر: 2013/09/19
Narendra Kumar Mallik
من قبل Narendra Kumar Mallik , Software Engineer , Microsoft R & D India

If you create a static class instead of singleton class then you cannot pass the object of the class as  a function parameter. 

static class contains only static members but singleton class can contain every type of member.

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟