Dinesh Kumar Babu wrote:The below mentioned Synchronization syntax helps to set the block code executed at once.
I don't know what exactly you mean be "executed at once". With synchronization you can make sure that only one thread at a time can execute a block of code. But it doesn't mean that the block of code is not going to be interrupted by thread scheduling.