欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

Java Object类,

来源: javaer 分享于  点击 1819 次 点评:58

Java Object类,


Object

1.equals()

 public boolean equals(Object obj) {
        return (this == obj);
    }


2.toString()

 public String toString() {
        return getClass().getName() + "@" + Integer.toHexString(hashCode());
    }


3.wait()

public final void wait() throws InterruptedException {
        wait(0);
    }


4.wait(long,int)

public final void wait(long timeout, int nanos) throws InterruptedException {
        if (timeout < 0) {
            throw new IllegalArgumentException("timeout value is negative");
        }

        if (nanos < 0 || nanos > 999999) {
            throw new IllegalArgumentException(
                                "nanosecond timeout value out of range");
        }

        if (nanos > 0) {
            timeout++;
        }

        wait(timeout);
    }


相关文章

    暂无相关文章
相关栏目:

用户点评