Alternative to TimerTask, which supports waiting for completion?
<p>I want to create a class that IS A <code>TimerTask</code> and also a <code>Thread</code>. 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 <a href="http://stackoverflow.com/questions/15333891/need-to-fix-my-java-timer-code">here</a>. </p>

<p>Java class CANNOT inherit from two classes. So, how do I fix this problem? </p>

<p>The reason is in the post i mentioned in my question. </p>

<p><em>Actual output:</em>
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. </p>

<p><em>Expected output:</em>
I want the end print statement of main to come after everything else.</p>
