This tutorial will help you to understand how to suspend and resume threads in java.
run following java programs in your IDEs. I suggest using Eclipse.
In this program we are suspending thread just once.
but if you want to suspend thread each time you increment ‘i’ then,
i have commented previous mysuspend(),myresume() function and just call them in your for loop.