i am using sleep method of class Thread in java, can anyone tell how avoid this thing
<p>i am using sleep because one method is taking time to execute and i  want to execute next method when it is completed. this is what i am trying.</p>

<pre><code>method1();
Thread.sleep(3000);
method2();
</code></pre>
