Object源码
publicclassObject {
privatestaticnativevoidregisterNatives();
static{
registerNatives();
}
publicfinalnativeClass getClass();
publicnativeinthashCode();
publicbooleanequals(Object obj) {
return(this== obj);
}
protectednativeObject clone()throwsCloneNotSupportedException;
publicString toString() {
returngetClass().getName() +"@"+ Integer.toHexString(hashCode());
}
publicfinalnativevoidnotify();
publicfinalnativevoidnotifyAll();
publicfinalnativevoidwait(longtimeout)throwsInterruptedException;
publicfinalvoidwait(longtimeout,intnanos)throwsInterruptedException {
if(timeout <0) {
thrownewIllegalArgumentException("timeout value is negative");
}
if(nanos <0|| nanos >999999) {
thrownewIllegalArgumentException(
"nanosecond timeout value out of range");
}
if(nanos >=500000|| (nanos !=0&& timeout ==0)) {
timeout++;
}
wait(timeout);
}
publicfinalvoidwait()throwsInterruptedException {
wait(0);
}
protectedvoidfinalize()throwsThrowable { }
}
下面是这些方法:
registerNatives()
getClass()
hashCode()
equals(Object obj)
clone()
toString()
notify()
notifyAll()
wait(long timeout)
wait(long timeout, int nanos)
wait()
finalize()