Showing posts with label java synchronization. Show all posts
Showing posts with label java synchronization. Show all posts

Can you synchronize the constructor of object in Java

According to the Java language specification you can not use java synchronized keyword with constructor it’s illegal and result in compilation error. So you can not synchronized constructor in Java which seems logical because other threads cannot see the object being created until the thread creating it has finished it.