Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

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

user-image
Question added by Mohd shahnawaz khan , Associate Project , Cognizant Technology Solution
Date Posted: 2013/08/31
George El Haddad
by 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

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.