⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 18.doc.html

📁 java语言规范
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<a name="45328"></a>
<p>
<pre><a name="44399"></a>
	/**
<a name="44400"></a>	 * Returns a String that represents this Object.
<a name="44401"></a>	 * It is recommended that all subclasses override
<a name="44402"></a>	 * this method.
<a name="44403"></a>	 */
<a name="44404"></a>	public String toString() {
<a name="44405"></a>		return getClass().getName() + "@" +
<a name="44406"></a>			Integer.toHexString(hashCode());
<a name="44407"></a>	}
<br><a name="44409"></a>
	/**
<a name="44410"></a>	 * Notifies a single waiting thread on a change in
<a name="44411"></a>	 * condition of another thread. The thread effecting
<a name="44412"></a>	 * the change notifies the waiting thread using notify().
<a name="44413"></a>	 * Threads that want to wait for a condition to change
<a name="44414"></a>	 * before proceeding can call wait(). &lt;p&gt;
<a name="44415"></a>	 * &lt;em&gt;The method notify() can be called only by the
<a name="44416"></a>	 * thread that is the owner of the current object's
<a name="44417"></a>	 * monitor lock.&lt;/em&gt;
<a name="44418"></a>	 *
<a name="44419"></a>	 * @exception					IllegalMonitorStateException If the
<a name="44420"></a>	 * 						current thread is not the owner
<a name="44421"></a>	 * 						of the Object's monitor lock.
<a name="44422"></a>	 * @see				Object#wait
<a name="44423"></a>	 * @see				Object#notifyAll
<a name="44424"></a>	 */
<a name="44425"></a>	public final native void notify();
<br><a name="44427"></a>
	/**
<a name="44428"></a>	 * Notifies all the threads waiting for a condition to
<a name="44429"></a>	 * change. Threads that are waiting are generally waiting
<a name="44430"></a>	 * for another thread to change some condition. Thus, the
<a name="44431"></a>	 * thread effecting a change that more than one thread is
<a name="44432"></a>	 * waiting for notifies all the waiting threads using
<a name="44433"></a>	 * the method notifyAll(). Threads that want to wait for
<a name="44434"></a>	 * a condition to change before proceeding can call
<a name="44435"></a>	 * wait(). &lt;p&gt;
<a name="44436"></a>	 * &lt;em&gt;The method notifyAll() can be called only by the
<a name="44437"></a>	 * thread that is the owner of the current object's
<a name="44438"></a>	 * monitor lock.&lt;/em&gt;
<a name="44439"></a>	 *
<a name="44555"></a>	 * @exception					IllegalMonitorStateException If the
<a name="44556"></a>	 * 						current thread is not the owner
<a name="44557"></a>	 * 						of the Object's monitor lock.
<a name="44443"></a>	 * @see				Object#wait
<a name="44444"></a>	 * @see				Object#notify
<a name="44445"></a>	 */
<a name="44446"></a>	public final native void notifyAll();
<br></pre><pre><a name="44448"></a>
	/**
<a name="44449"></a>	 * Causes a thread to wait until it is notified or the
<a name="44450"></a>	 * specified timeout expires. &lt;p&gt;
<a name="44451"></a>	 * &lt;em&gt;The method wait(millis) can be called only by
<a name="44452"></a>	 * the thread that is the owner of the current object's
<a name="44453"></a>	 * monitor lock.&lt;/em&gt;
<a name="44454"></a>	 *
<a name="44455"></a>	 * @param 				millis			the maximum time to wait,
<a name="44456"></a>	 * 								in milliseconds
<a name="44559"></a>	 * @exception					IllegalMonitorStateException If the
<a name="44560"></a>	 * 						current thread is not the owner
<a name="44561"></a>	 * 						of the Object's monitor lock.
<a name="44460"></a>	 * @exception 					InterruptedException Another thread has
<a name="44461"></a>	 * 						interrupted this thread. 
<a name="44462"></a>	 */
<a name="44463"></a>	public final native void wait(long millis)
<a name="44464"></a>		throws InterruptedException;
<br><a name="44466"></a>
	/**
<a name="44467"></a>	 * More accurate wait.
<a name="44468"></a>	 * &lt;em&gt;The method wait(millis, nanos) can be called only
<a name="44469"></a>	 * by the thread that is the owner of the current
<a name="44470"></a>	 * object's monitor lock.&lt;/em&gt;
<a name="44471"></a>	 *
<a name="44472"></a>	 * @param millis						the maximum time to wait,
<a name="44473"></a>	 * 							in milliseconds
<a name="44474"></a>	 * @param nano						additional time to wait,
<a name="44475"></a>	 * 							in nanoseconds
<a name="44476"></a>	 * 							(range 0-999999)
<a name="44563"></a>	 * @exception					IllegalMonitorStateException If the
<a name="44564"></a>	 * 						current thread is not the owner
<a name="44565"></a>	 * 						of the Object's monitor lock.
<a name="44566"></a>	 * @exception 					InterruptedException Another thread has
<a name="44567"></a>	 * 						interrupted this thread. 
<a name="44543"></a>	 */
<a name="44483"></a>	public final void wait(long millis, int nanos)
<a name="44484"></a>		throws InterruptedException
<a name="44485"></a>	{
<a name="44486"></a>		if (nanos &gt;= 500000 || (nanos != 0 &amp;&amp; millis==0))
<a name="44487"></a>			timeout++;
<a name="44488"></a>		wait(timeout);
<a name="44489"></a>	}
<br><a name="44491"></a>
	/**
<a name="44492"></a>	 * Causes a thread to wait forever until it is notified.
<a name="44493"></a>	 * &lt;p&gt;
<a name="44494"></a>	 * &lt;em&gt;The method wait() can be called only by the
<a name="44495"></a>	 * thread that is the owner of the current object's
<a name="44496"></a>	 * monitor lock.&lt;/em&gt;
<a name="44497"></a>	 *
</pre><pre><a name="44569"></a>	 * @exception					IllegalMonitorStateException If the
<a name="44570"></a>	 * 						current thread is not the owner
<a name="44571"></a>	 * 						of the Object's monitor lock.
<a name="44572"></a>	 * @exception 					InterruptedException Another thread has
<a name="44573"></a>	 * 						interrupted this thread. 
<a name="44503"></a>	 */
<a name="44504"></a>	public final void wait() throws InterruptedException {
<a name="44505"></a>		wait(0);
<a name="44506"></a>	}
<br></pre><pre><a name="44508"></a>
	/**
<a name="44509"></a>	 * Code to perform when this object is garbage collected.
<a name="44510"></a>	 * The default is that nothing needs to be performed.
<a name="44511"></a>	 * 
<a name="44512"></a>	 * Any exception thrown by a finalize method causes the
<a name="44513"></a>	 * finalization to halt.  But otherwise, it is ignored.
<a name="44514"></a>	 */
<a name="44515"></a>	protected void finalize() throws Throwable { }
<br><a name="44516"></a>}
</pre><a name="44904"></a>
From this source code, the <code>javadoc</code> tool produced the following HTML file, 
which is available for browsing at <code>http://java.sun.com/Series</code>, our Java 
Series web site:
<p><a name="44575"></a>
<p><font size=-1>&lt;!--NewPage--&gt;</font><p>
<a name="44576"></a>
<p><font size=-1>&lt;html&gt;</font><p>
<a name="44577"></a>
<p><font size=-1>&lt;head&gt;</font><p>
<a name="44578"></a>
<p><font size=-1>&lt;!-- Generated by javadoc on Wed Jun 26 11:40:38 EDT 1996 --&gt;</font><p>
<a name="44579"></a>
<p><font size=-1>&lt;a name="_top_"&gt;&lt;/a&gt;</font><p>
<a name="44580"></a>
<p><font size=-1>&lt;title&gt;</font><p>
<a name="44581"></a>
<p><font size=-1>  Class java.lang.Object</font><p>
<a name="44582"></a>
<p><font size=-1>&lt;/title&gt;</font><p>
<a name="44583"></a>
<p><font size=-1>&lt;/head&gt;</font><p>
<a name="44584"></a>
<p><font size=-1>&lt;body&gt;</font><p>
<a name="44585"></a>
<p><font size=-1>&lt;pre&gt;</font><p>
<a name="44919"></a>
<p><font size=-1>&lt;a href="packages.html"&gt;All Packages&lt;/a&gt;  &lt;a href="tree.html"&gt;Class Hierarchy&#172;<br>&lt;/a&gt;  &lt;a href="Package-java.lang.html"&gt;This Package&lt;/a&gt;  &lt;a href="java.lang.N&#172;<br>umber.html#_top_"&gt;Previous&lt;/a&gt;  &lt;a href="java.lang.OutOfMemoryError.html#_top&#172;<br>_"&gt;Next&lt;/a&gt;  &lt;a href="AllNames.html"&gt;Index&lt;/a&gt;&lt;/pre&gt;</font><p>
<a name="44920"></a>
<p><font size=-1>&lt;hr&gt;</font><p>
<a name="44588"></a>
<p><font size=-1>&lt;h1&gt;</font><p>
<a name="44589"></a>
<p><font size=-1>  Class java.lang.Object</font><p>
<a name="44590"></a>
<p><font size=-1>&lt;/h1&gt;</font><p>
<a name="44591"></a>
<p><font size=-1>&lt;pre&gt;</font><p>
<a name="44592"></a>
<p><font size=-1>java.lang.Object</font><p>
<a name="44593"></a>
<p><font size=-1>&lt;/pre&gt;</font><p>
<a name="44594"></a>
<p><font size=-1>&lt;hr&gt;</font><p>
<a name="44595"></a>
<p><font size=-1>&lt;dl&gt;</font><p>
<a name="44596"></a>
<p><font size=-1>  &lt;dt&gt; public class &lt;b&gt;Object&lt;/b&gt;</font><p>
<a name="44597"></a>
<p><font size=-1>&lt;/dl&gt;</font><p>
<a name="44598"></a>
<p><font size=-1>The root of the Class hierarchy.  Every Class in the</font><p>
<a name="44599"></a>
<p><font size=-1>system has Object as its ultimate parent.  Every variable</font><p>
<a name="44600"></a>
<p><font size=-1>and method defined here is available in every Object.</font><p>
<a name="44601"></a>
<p><font size=-1>&lt;dl&gt;</font><p>
<a name="44602"></a>
<p><font size=-1>  &lt;dt&gt; &lt;b&gt;Version:&lt;/b&gt;</font><p>
<a name="44603"></a>
<p><font size=-1>  &lt;dd&gt; 1.37, 26 Jun 1996</font><p>
<a name="44604"></a>
<p><font size=-1>    &lt;dt&gt; &lt;b&gt;See Also:&lt;/b&gt;</font><p>
<a name="44605"></a>
<p><font size=-1>    &lt;dd&gt; &lt;a href="java.lang.Class.html#_top_"&gt;Class&lt;/a&gt;</font><p>
<a name="44606"></a>
<p><font size=-1>&lt;/dl&gt;</font><p>
<a name="44607"></a>
<p><font size=-1>&lt;hr&gt;</font><p>
<a name="44608"></a>
<p><font size=-1>&lt;a name="index"&gt;&lt;/a&gt;</font><p>
<a name="44938"></a>
<p><font size=-1>&lt;h2&gt;</font><p>
<a name="44939"></a>
<p><font size=-1>  &lt;img src="images/constructor-index.gif" width=275 height=38 alt="Constructo&#172;<br>r Index"&gt;</font><p>
<a name="44926"></a>
<p><font size=-1>&lt;/h2&gt;</font><p>
<a name="44612"></a>
<p><font size=-1>&lt;dl&gt;</font><p>
<a name="44613"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>
<a name="44614"></a>
<p><font size=-1>	&lt;a href="#Object()"&gt;&lt;b&gt;Object&lt;/b&gt;&lt;/a&gt;()</font><p>
<a name="44615"></a>
<p><font size=-1>  &lt;dd&gt; </font><p>
<a name="44616"></a>
<p><font size=-1>&lt;/dl&gt;</font><p>
<a name="44617"></a>
<p><font size=-1>&lt;h2&gt;</font><p>
<a name="44618"></a>
<p><font size=-1>  &lt;img src="images/method-index.gif" width=207 height=38 alt="Method Index"&gt;</font><p>
<a name="44619"></a>
<p><font size=-1>&lt;/h2&gt;</font><p>
<a name="44620"></a>
<p><font size=-1>&lt;dl&gt;</font><p>
<a name="44621"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/red-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>
<a name="44622"></a>
<p><font size=-1>	&lt;a href="#clone()"&gt;&lt;b&gt;clone&lt;/b&gt;&lt;/a&gt;()</font><p>
<a name="44623"></a>
<p><font size=-1>  &lt;dd&gt; Creates a clone of the object.</font><p>
<a name="44624"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/red-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>
<a name="44625"></a>
<p><font size=-1>	&lt;a href="#equals(java.lang.Object)"&gt;&lt;b&gt;equals&lt;/b&gt;&lt;/a&gt;(Object)</font><p>
<a name="44626"></a>
<p><font size=-1>  &lt;dd&gt; Compares two Objects for equality.</font><p>
<a name="44627"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/red-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>
<a name="44628"></a>
<p><font size=-1>	&lt;a href="#finalize()"&gt;&lt;b&gt;finalize&lt;/b&gt;&lt;/a&gt;()</font><p>
<a name="44629"></a>
<p><font size=-1>  &lt;dd&gt; Code to perform when this object is garbage collected.</font><p>
<a name="44630"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/red-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>
<a name="44631"></a>
<p><font size=-1>	&lt;a href="#getClass()"&gt;&lt;b&gt;getClass&lt;/b&gt;&lt;/a&gt;()</font><p>
<a name="44632"></a>
<p><font size=-1>  &lt;dd&gt; Returns the Class of this Object.</font><p>
<a name="44633"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/red-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>
<a name="44634"></a>
<p><font size=-1>	&lt;a href="#hashCode()"&gt;&lt;b&gt;hashCode&lt;/b&gt;&lt;/a&gt;()</font><p>
<a name="44635"></a>
<p><font size=-1>  &lt;dd&gt; Returns a hashcode for this Object.</font><p>
<a name="44636"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/red-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>
<a name="44637"></a>
<p><font size=-1>	&lt;a href="#notify()"&gt;&lt;b&gt;notify&lt;/b&gt;&lt;/a&gt;()</font><p>
<a name="44638"></a>
<p><font size=-1>  &lt;dd&gt; Notifies a single waiting thread on a change in</font><p>
<a name="44639"></a>
<p><font size=-1>condition of another thread.</font><p>
<a name="44640"></a>
<p><font size=-1>  &lt;dt&gt; &lt;img src="images/red-ball-small.gif" width=6 height=6 alt=" o "&gt;</font><p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -