If i create a new thread inside a synchronized block, will the block remain locked till the thread execution is also complete? If not, then till when would it remain locked
no thread has a separate life. synchronized block will be blocked only till starting point of the thread in above case.
It would only remained locked if the code join()d with the newly created thread, thus waiting for it to finish. As there is no join()
the lock will be released after the call to start()
has completed.