I want to create a class that IS A TimerTask
and also a Thread
. I am assuming that there is nothing wrong with this idea. The reason why I am doing it is mentioned in the "desired output" section of my post here.
Java class CANNOT inherit from two classes. So, how do I fix this problem?
The reason is in the post i mentioned in my question.
Actual output: All timer tasks are executed in the main method. My main code's last print statement is displayed before all the timer tasks are executed. I don't want that.
Expected output: I want the end print statement of main to come after everything else.