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);
    }
}
  1. J2ME的Object跟J2SE的并没有太多的不同。
  2. 并没有registerNatives方法。
  3. 多数是需JVM来实现的方法。
  4. 没有finalize了。
  5. 没有复制clone方法。J2ME并常用到clone方法。
  6. ==跟equal是一样的。
评论
发表评论

您还没有登录,请登录后发表评论

Azi
搜索本博客
存档
最新评论