首页 arrow 开发技术 arrow 程序设计 arrow 解读java.lang.Object
解读java.lang.Object
Author Author: 一滴蔚蓝色 | Date Date: 2008-09-08 | View Count View: 594 | Section & Category 开发技术 - 程序设计 | Digg 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);
    }
}

-----------------------------------

  1. J2ME的Object跟J2SE的并没有太多的不同。
  2. 并没有registerNatives方法。
  3. 多数是需JVM来实现的方法。
  4. 没有finalize了。
  5. 没有复制clone方法。J2ME并不常用到clone方法。
  6. ==跟equal是一样的。

 


更多阅读:

 

尚无评论发表

我要发表评论

登录菜单

最新文章

订阅本站

RSS 0.91 RSS 1.0 RSS 2.0 ATOM 0.3 OPML