What is the purpose of using the synchronnized blocks here ? because i don't see multithreads . The program has only a one thread : the main thread ! possible explanation : passing argument from the console for more than one person is considered as a multithreading and the excecution of code should be done for each of the persons , but i still don't see the need of doing that . a while loop instead would accomplish the purpose of the program :