📄 object.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Sep 24 14:57:47 PDT 2003 -->
<TITLE>
MID Profile: Class Object
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Object.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/lang/Math.html"><B>PREV CLASS</B></A>
<A HREF="../../java/lang/Runtime.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="Object.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.lang</FONT>
<BR>
Class Object</H2>
<PRE>
<B>java.lang.Object</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Object</B></DL>
<P>
Class <code>Object</code> is the root of the class hierarchy. Every class has <code>Object</code> as a superclass. All objects, including arrays, implement the methods of this class.
<P>
<DL>
<DT><B>Since: </B><DD>JDK1.0, CLDC 1.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../java/lang/Class.html"><CODE>Class</CODE></A></DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/lang/Object.html#Object()">Object</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A></B>(<A HREF="../../java/lang/Object.html">Object</A> obj)</CODE>
<BR>
Indicates whether some other object is "equal to" this one.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../java/lang/Class.html">Class</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#getClass()">getClass</A></B>()</CODE>
<BR>
Returns the runtime class of an object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#hashCode()">hashCode</A></B>()</CODE>
<BR>
Returns a hash code value for the object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#notify()">notify</A></B>()</CODE>
<BR>
Wakes up a single thread that is waiting on this object's monitor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A></B>()</CODE>
<BR>
Wakes up all threads that are waiting on this object's monitor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#toString()">toString</A></B>()</CODE>
<BR>
Returns a string representation of the object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#wait()">wait</A></B>()</CODE>
<BR>
Causes current thread to wait until another thread invokes the <A HREF="../../java/lang/Object.html#notify()"><CODE>notify()</CODE></A> method or the <A HREF="../../java/lang/Object.html#notifyAll()"><CODE>notifyAll()</CODE></A> method for this object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#wait(long)">wait</A></B>(long timeout)</CODE>
<BR>
Causes current thread to wait until either another thread invokes the <A HREF="../../java/lang/Object.html#notify()"><CODE>notify()</CODE></A> method or the <A HREF="../../java/lang/Object.html#notifyAll()"><CODE>notifyAll()</CODE></A> method for this object, or a specified amount of time has elapsed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></B>(long timeout, int nanos)</CODE>
<BR>
Causes current thread to wait until another thread invokes the <A HREF="../../java/lang/Object.html#notify()"><CODE>notify()</CODE></A> method or the <A HREF="../../java/lang/Object.html#notifyAll()"><CODE>notifyAll()</CODE></A> method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Object()"><!-- --></A><H3>
Object</H3>
<PRE>
public <B>Object</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getClass()"><!-- --></A><H3>
getClass</H3>
<PRE>
public final <A HREF="../../java/lang/Class.html">Class</A> <B>getClass</B>()</PRE>
<DL>
<DD>Returns the runtime class of an object. That <tt>Class</tt> object is the object that is locked by <tt>static synchronized</tt> methods of the represented class.<DD><DL>
<DT><B>Returns:</B><DD>the object of type <code>Class</code> that represents the runtime class of the object.</DL>
</DD>
</DL>
<HR>
<A NAME="hashCode()"><!-- --></A><H3>
hashCode</H3>
<PRE>
public int <B>hashCode</B>()</PRE>
<DL>
<DD>Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by <code>java.util.Hashtable</code>. <p> The general contract of <code>hashCode</code> is: <ul> <li>Whenever it is invoked on the same object more than once during an execution of a Java application, the <tt>hashCode</tt> method must consistently return the same integer, provided no information used in <tt>equals</tt> comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. <li>If two objects are equal according to the <tt>equals(Object)</tt> method, then calling the <code>hashCode</code> method on each of the two objects must produce the same integer result. <li>It is <em>not</em> required that if two objects are unequal according to the <A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>equals(java.lang.Object)</CODE></A> method, then calling the <tt>hashCode</tt> method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. </ul> <p> As much as is reasonably practical, the hashCode method defined by class <tt>Object</tt> does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the Java<font size="-2"><sup>TM</sup></font> programming language.)<DD><DL>
<DT><B>Returns:</B><DD>a hash code value for this object.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>equals(java.lang.Object)</CODE></A>,
<A HREF="../../java/util/Hashtable.html"><CODE>Hashtable</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="equals(java.lang.Object)"><!-- --></A><H3>
equals</H3>
<PRE>
public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A> obj)</PRE>
<DL>
<DD>Indicates whether some other object is "equal to" this one. <p> The <code>equals</code> method implements an equivalence relation: <ul> <li>It is <i>reflexive</i>: for any reference value <code>x</code>, <code>x.equals(x)</code> should return <code>true</code>. <li>It is <i>symmetric</i>: for any reference values <code>x</code> and <code>y</code>, <code>x.equals(y)</code> should return <code>true</code> if and only if <code>y.equals(x)</code> returns <code>true</code>. <li>It is <i>transitive</i>: for any reference values <code>x</code>, <code>y</code>, and <code>z</code>, if <code>x.equals(y)</code> returns <code>true</code> and <code>y.equals(z)</code> returns <code>true</code>, then <code>x.equals(z)</code> should return <code>true</code>. <li>It is <i>consistent</i>: for any reference values <code>x</code> and <code>y</code>, multiple invocations of <tt>x.equals(y)</tt> consistently return <code>true</code> or consistently return <code>false</code>, provided no information used in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -