1、Object类

  1. Java中所有类的根类

2、toString方法

  1. 1)默认获取对象的地址值<br /> ![a00f9659748b7ee617980e46ae74c5fb28e899efae657a2daf7c92013829778c.png](https://cdn.nlark.com/yuque/0/2022/png/28344462/1652104310392-0c261f97-9392-4e2a-a633-0fc984b553d4.png#clientId=u5434aac4-0274-4&crop=0&crop=0&crop=1&crop=1&from=ui&height=60&id=u24ffd05f&margin=%5Bobject%20Object%5D&name=a00f9659748b7ee617980e46ae74c5fb28e899efae657a2daf7c92013829778c.png&originHeight=97&originWidth=827&originalType=binary&ratio=1&rotation=0&showTitle=false&size=9178&status=done&style=none&taskId=u560b8ff6-fd07-4170-af27-efe5ca4a340&title=&width=514.2000122070312) <br /> (2)通常需要对该方法重写,根据需要打印属性

3、equals方法

  1. 1)默认比较两个对象的地址值,使用==进行比较<br /> ![73.png](https://cdn.nlark.com/yuque/0/2022/png/28344462/1652104604379-60fcd08b-a295-40f7-ab0d-f7e6697266a6.png#clientId=u5434aac4-0274-4&crop=0&crop=0&crop=1&crop=1&from=ui&id=uea6e67a3&margin=%5Bobject%20Object%5D&name=73.png&originHeight=98&originWidth=433&originalType=binary&ratio=1&rotation=0&showTitle=false&size=6675&status=done&style=none&taskId=ud37296a6-0a30-4a64-b88c-3f1ae4694a1&title=)<br /> (2)通常自定义类会重写该方法,比较属性值(String类重写了equals方法,可以比较字符串内容的)