Java Object类,
分享于 点击 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);
}
相关文章
- 暂无相关文章
用户点评