zoukankan      html  css  js  c++  java
  • Object

    一、源码

    public final native Class<?> getClass();

    获得运行时的类

    public native int hashCode();
    

    获得hash码

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

    判断对象是否相等

    protected native Object clone() throws CloneNotSupportedException;
    

    克隆

    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 timeout) throws InterruptedException;
    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);
    }
    public final void wait() throws InterruptedException {
        wait(0);
    }
    

    使当前线程等待

    protected void finalize() throws Throwable { }
    

    垃圾回收器调用回收对象

  • 相关阅读:
    STL
    Makefile
    配置pyqt5环境 for python3.4 on Linux Mint 17.1
    SELinux Policy Macros
    python爬虫
    python常用模块
    python中if __name__ == '__main__':
    Centos 7 .Net core后台守护进程Supervisor配置
    阅读Google Protocol Buffers 指南,整理pb语法
    Google Protocol Buffers 入门
  • 原文地址:https://www.cnblogs.com/ctxsdhy/p/12241845.html
Copyright © 2011-2022 走看看