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

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

متابعة

Can we synchronized a constructor? Give the reason for your answer.

user-image
تم إضافة السؤال من قبل Mohd shahnawaz khan , Associate Project , Cognizant Technology Solution
تاريخ النشر: 2013/08/31
George El Haddad
من قبل George El Haddad , Software Engineer (Freelance) , Scientific Software Consultancy & Training

Check this detailed answer on stackoverflow about synchronizing a constructor. It is not allowed by the Java language specification but they show examples on how you can kind of do it via a small hack. It seems dangerous, but it can still be done.

Check it out here http://stackoverflow.com/questions/4880168/why-cant-java-constructors-be-synchronized

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

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