Java中Object对象方法

在这里插入图片描述
1.clone() 复制

2.getClass() 获取对象的class

3.equals() 对象值比较,重写equals方法必须重写hashcode,对象的约定,例如不重写,hashMap的kv不一致;

4.hashCode() 对象的hash值

5.tostring() 默认方法是 包名@改对象的hashCode十六进制表示

6.notify() 线程唤起

7.notifyall() 线程全部唤起

8.wait() 线程等待

9.finalize() 基本没啥用,垃圾回收前调用的方法