/** * Class {@code Object} is the root of the class hierarchy. * Every class has {@code Object} as a superclass. All objects, * including arrays, implement the methods of this class. * * @author unascribed * @see java.lang.Class * @since JDK1.0 */ publicclassObject{ //装载本地库函数。基本上属于 Native 方法的多少都跟 JVM带点关系,这些追踪的到最后都会变成.cpp,所以就不深究了。 privatestaticnativevoidregisterNatives(); //装载本地库函数,用于载入Obejct类中调用的本地库 static { registerNatives(); }
publicfinalnativevoidwait(long timeout)throws InterruptedException; publicfinalvoidwait(long timeout, int nanos)throws InterruptedException { if (timeout < 0) { thrownew IllegalArgumentException("timeout value is negative"); }
if (nanos < 0 || nanos > 999999) { thrownew IllegalArgumentException( "nanosecond timeout value out of range"); }