|
解读java.lang.Object
|
Author: 一滴蔚蓝色 | Date: 2008-09-08 |
View: 594 |
开发技术 - 程序设计 | Digg:
0
|
|
public class Object
{
public Object()
{
}
public final native Class getClass();
public native int hashCode();
public boolean equals(Object obj)
{
return this == obj;
}
public String toString()
{
return getClass().getName() + "@" + Integer.toHexString(hashCode());
}
public final native void notify();
public final native void notifyAll();
public final native void wait(long l)
throws InterruptedException;
public final void wait(long l, int i)
throws InterruptedException
{
if(l < 0L)
throw new IllegalArgumentException("timeout value is negative");
if(i < 0 || i > 0xf423f)
throw new IllegalArgumentException("nanosecond timeout value out of range");
if(i >= 0x7a120 || i != 0 && l == 0L)
l++;
wait(l);
}
public final void wait()
throws InterruptedException
{
wait(0L);
}
}
-----------------------------------
- J2ME的Object跟J2SE的并没有太多的不同。
- 并没有registerNatives方法。
- 多数是需JVM来实现的方法。
- 没有finalize了。
- 没有复制clone方法。J2ME并不常用到clone方法。
- ==跟equal是一样的。
更多阅读:
|