Java根类Object的方法说明

原文链接: https://my.oschina.net/u/3708595/blog/1559106

Java中的Object类是所有类的父类,它提供了以下11个方法:

  1. public final native Class getClass()
  2. public native int hashCode()
  3. public boolean equals(Object obj)
  4. protected native Object clone() throws CloneNotSupportedException
  5. public String toString()
  6. public final native void notify()
  7. public final native void notifyAll()
  8. public final native void wait(long timeout) throws InterruptedException
  9. public final void wait(long timeout, int nanos) throws InterruptedException
  10. public final void wait() throws InterruptedException
  11. protected void finalize() throws Throwable { }

下面我们一个个方法进行分析,看这些方法到底有什么作用:

https://fangjian0423.github.io/2016/03/12/java-Object-method/

转载于:https://my.oschina.net/u/3708595/blog/1559106

你可能感兴趣的:(Java根类Object的方法说明)