your timer runs as a separate
thread, which means the program won't exit until the timer terminates.
As timer typically runs in an eternal loop it never terminates unless you tell it specifically that it should by calling its cancel() method.
I suggest you check out the API docs, they're there for a reason.
It clearly states:
After the last live reference to a Timer object goes away and all outstanding tasks have completed execution, the timer's task execution thread terminates gracefully (and becomes subject to garbage collection). However, this can take arbitrarily long to occur. By default, the task execution thread does not run as a daemon thread, so it is capable of keeping an application from terminating. If a caller wants to terminate a timer's task execution thread rapidly, the caller should invoke the the timer's cancel method.