I read the link of the Timer example
Use java.util.Timer to schedule a task to execute once 5 seconds have passed : Timer*«*Development Class*«*Java
It used both Timer and TimerTask together. timer.schedule() calls run(). That is why I also used Timer. If there is a way not to use Timer to do the scheduled work, please let me know.
As I said, the customers arrival times are in the input file. There is no randomness in the project.
The only thing that is a little more general is the number of windows are in the file. It could be any positive integer.
The array is in fact an array of queues with push and pop methods in the queue. The array is a property inside a subclass of the TimerTask.
I am confused between when to using Timer and TimerTask vs Thread. Is Thread for handling random events?
I am trying to not to use Thread as JosAH said.
Thank you all very much.
TimerTask and Timer vs Thread from Jodokus's link
■if it may take a long time, or may block, use a Thread
■if it is to be done later, or periodically, use TimerTask and Timer (which itself uses a background thread)
So for me, TimerTask and Timer are ok.