[Gaurav]: Now my only question is that will it be safe for my scheduler (which extends timer task) to have non-static private variables Yes, if you're careful. The task will run in a different
thread than it was initialized in, so you need to pay attention to whether the variables are used in two different threads, or just one. Since you're setting them in the constructor, which is necessarily
before the task is run, they must be used in two threads. Therefore you need to either use some protection (synchronization/locking/volatile) when accessing them, or simply make the variables final (which is easier whenever it's possible at all).