<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Find Answers For ... - Recent questions tagged wait</title>
<link>https://find4answers.com/tag/wait</link>
<description>Powered by Question2Answer</description>
<item>
<title>How can you specify which thread is notified with the wait/notify protocol?</title>
<link>https://find4answers.com/31/how-specify-which-thread-notified-with-wait-notify-protocol</link>
<description>&lt;p&gt;
	How can you specify which thread is notified with the wait/notify protocol?&lt;/p&gt;
&lt;p&gt;
	1) Pass the object reference as a parameter to the &lt;i&gt;notify&lt;/i&gt; method&lt;br&gt;
	2) Pass the method name as a parameter to the &lt;i&gt;notify&lt;/i&gt; method&lt;br&gt;
	3) Use the &lt;i&gt;notifyAll&lt;/i&gt; method and pass the object reference as a parameter&lt;br&gt;
	4) None of the above&lt;/p&gt;</description>
<category>Java/J2EE</category>
<guid isPermaLink="true">https://find4answers.com/31/how-specify-which-thread-notified-with-wait-notify-protocol</guid>
<pubDate>Tue, 15 Nov 2011 09:56:07 +0000</pubDate>
</item>
<item>
<title>What will happen when you attempt to compile and run the following code?</title>
<link>https://find4answers.com/30/what-will-happen-when-you-attempt-compile-and-following-code</link>
<description>&lt;pre&gt;
What will happen when you attempt to compile and run the following code?


public class WaNot{
int i=0;
public static void main(String argv[]){
        WaNot w = new WaNot();
        w.amethod();
        }
        public void amethod(){
	while(true){
		try{ 
        		wait();
		    }catch (InterruptedException e) {}
		i++;
	    }//End of while

	}//End of amethod
}//End of class&lt;/pre&gt;</description>
<category>Java/J2EE</category>
<guid isPermaLink="true">https://find4answers.com/30/what-will-happen-when-you-attempt-compile-and-following-code</guid>
<pubDate>Tue, 15 Nov 2011 09:50:38 +0000</pubDate>
</item>
<item>
<title>Which best describes the synchronized keyword?</title>
<link>https://find4answers.com/29/which-best-describes-the-synchronized-keyword</link>
<description>&lt;p&gt;
	Which best describes the &lt;i&gt;synchronized&lt;/i&gt; keyword?&lt;/p&gt;
&lt;p&gt;
	1) Allows more than one Thread to access a method simultaneously&lt;br&gt;
	2) Allows more than one Thread to obtain the Object lock on a reference&lt;br&gt;
	3) Gives the notify/&lt;i&gt;notifyAll&lt;/i&gt; keywords exclusive access to the monitor&lt;br&gt;
	4) Means only one thread at a time can access a method or block of code&lt;/p&gt;</description>
<category>Java/J2EE</category>
<guid isPermaLink="true">https://find4answers.com/29/which-best-describes-the-synchronized-keyword</guid>
<pubDate>Tue, 15 Nov 2011 09:43:45 +0000</pubDate>
</item>
<item>
<title>Why do you need the wait/notify protocol?</title>
<link>https://find4answers.com/27/why-do-you-need-the-wait-notify-protocol</link>
<description>&lt;p&gt;
	&lt;span style=&quot;font-family: GENEVA, HELVETICA, ARIAL, LUCIDA SANS;&quot;&gt;Write code using synchronized wait &lt;i&gt;notify&lt;/i&gt; and &lt;i&gt;notifyAll&lt;/i&gt; to protect against concurrent access problems and to communicate between threads. Define the interaction between threads and between threads and object locks when executing synchronized wait &lt;i&gt;notify&lt;/i&gt; or &lt;i&gt;notifyAll&lt;/i&gt;.&lt;/span&gt;&lt;/p&gt;</description>
<category>Java/J2EE</category>
<guid isPermaLink="true">https://find4answers.com/27/why-do-you-need-the-wait-notify-protocol</guid>
<pubDate>Tue, 15 Nov 2011 08:58:31 +0000</pubDate>
</item>
<item>
<title>Which of the following keywords indicates a thread is releasing its Object lock?</title>
<link>https://find4answers.com/25/which-following-keywords-indicates-thread-releasing-object</link>
<description>Which of the following keywords indicates a thread is releasing its Object lock?&lt;br /&gt;
&lt;br /&gt;
1) release&lt;br /&gt;
2) wait&lt;br /&gt;
3) continue&lt;br /&gt;
4) notifyAll</description>
<category>Java/J2EE</category>
<guid isPermaLink="true">https://find4answers.com/25/which-following-keywords-indicates-thread-releasing-object</guid>
<pubDate>Tue, 15 Nov 2011 07:59:47 +0000</pubDate>
</item>
</channel>
</rss>