Object

作者: 盘丝仙仙 | 来源:发表于2019-11-23 10:48 被阅读0次

package com.lixing.base02;

/**

* @author: ZH

* @date: 2019/11/20 19:51

* @description: Object类

*/

public class ObjectTest {

public static void main(String[] args) {

new Object();

        //ZH总结 除了toString equals不是native方法,其他都是native方法

//主要方法有 getClass equals hashcode toString wait notify notifyAll

    }

}

/*

class Object0 {

private static native void registerNatives();

static {

registerNatives();

}

public final native Class getClass();

public native int hashCode();

public boolean equals(java.lang.Object obj) {

return (this == obj);

}

protected native java.lang.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;

protected void finalize() throws Throwable { }

}

*/

相关文章

网友评论

      本文标题:Object

      本文链接:https://www.haomeiwen.com/subject/rsthwctx.html