guys i figured out the solution. but i am still confused that what actually is going on in the main method. we first created the Clock object. But for what purpose Thread.sleep(4000) and Thread.sleep(1000) is? as per my understanding we are running the thread for 4 seconds and than stopping it using "isStopped" and what about Thread.sleep(1000) again?
lil help will be appreciated :)
You must be signed in to leave a comment
15 April 2021, 14:20
It works perfectly without Thread.sleep(1000) and verifies the task so this command was not needed at all