{"id":289,"date":"2026-07-20T16:43:03","date_gmt":"2026-07-20T08:43:03","guid":{"rendered":"http:\/\/ssjava.xyz\/index.php\/2026\/07\/19\/javase-03-%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1-%e2%86%92-%e2%91%a6object%e7%b1%bb%c2%b7%e4%b8%8b%ef%bc%88tostring%e3%80%81clone%e3%80%81getclass%e7%ad%89%ef%bc%89\/"},"modified":"2026-07-19T14:54:48","modified_gmt":"2026-07-19T06:54:48","slug":"25-object%e7%b1%bb%c2%b7%e4%b8%8b%ef%bc%88tostring%e3%80%81clone%e3%80%81getclass%e7%ad%89%ef%bc%89","status":"publish","type":"post","link":"https:\/\/ssjava.xyz\/index.php\/2026\/07\/20\/25-object%e7%b1%bb%c2%b7%e4%b8%8b%ef%bc%88tostring%e3%80%81clone%e3%80%81getclass%e7%ad%89%ef%bc%89\/","title":{"rendered":"25. Object\u7c7b\u00b7\u4e0b\uff08toString\u3001clone\u3001getClass\u7b49\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4e0a\u7bc7\u804a\u4e86 <code>equals<\/code> \u548c <code>hashCode<\/code>\uff0c\u8fd9\u4e24\u4e2a\u662f Object \u7c7b\u4e2d\u88ab\u91cd\u5199\u5f97\u6700\u591a\u7684\u65b9\u6cd5\u3002\u8fd9\u7bc7\u6211\u4eec\u628a\u5269\u4e0b\u7684\u65b9\u6cd5\u626b\u4e00\u904d\u2014\u2014\u6709\u7684\u5929\u5929\u7528\uff0c\u6709\u7684\u5df2\u7ecf\u8fc7\u65f6\u4e86\uff0c\u8fd8\u6709\u7684\u6839\u672c\u4e0d\u9700\u8981\u4f60\u81ea\u5df1\u53bb\u8c03\u7528\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001toString()\u2014\u2014\u6253\u5370\u5bf9\u8c61\u65f6\u81ea\u52a8\u8c03\u7528\u7684\u65b9\u6cd5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u5199 <code>System.out.println(obj)<\/code> \u7684\u65f6\u5019\uff0c\u5b9e\u9645\u4e0a\u5c31\u662f\u5728\u8c03\u7528 <code>obj.toString()<\/code>\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class Student {\n    String name = \"\u5f20\u4e09\";\n    int age = 20;\n}\n\nStudent s = new Student();\nSystem.out.println(s);\n\/\/ \u8f93\u51fa\uff1aStudent@1a2b3c4d  \u2190 \u7c7b\u540d@\u5341\u516d\u8fdb\u5236\u54c8\u5e0c\u503c\uff08Object \u9ed8\u8ba4\u5b9e\u73b0\uff09\n\/\/ \u8fd9\u73a9\u610f\u513f\u8c01\u770b\u5f97\u61c2\uff1f<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9ed8\u8ba4\u7684 <code>toString()<\/code> \u662f<code>\u7c7b\u540d@\u54c8\u5e0c\u503c\u7684\u5341\u516d\u8fdb\u5236<\/code>\u2014\u2014\u8bf4\u767d\u4e86\u5c31\u662f\u5bf9\u8c61\u7684\u5185\u90e8\u7f16\u53f7\u3002\u8c03\u8bd5\u7684\u65f6\u5019\u9ed8\u8ba4\u8f93\u51fa\u4ec0\u4e48\u4e5f\u770b\u4e0d\u51fa\u6765\uff0c\u6240\u4ee5<strong>\u51e0\u4e4e\u6240\u6709\u81ea\u5b9a\u4e49\u7c7b\u90fd\u5e94\u8be5\u91cd\u5199 toString()<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Override\npublic String toString() {\n    return \"Student{name='\" + name + \"', age=\" + age + \"}\";\n}\n\n\/\/ \u518d\u7528 System.out.println(s) \u8f93\u51fa\uff1a\n\/\/ Student{name='\u5f20\u4e09', age=20}\n\/\/ \u8fd9\u624d\u662f\u4eba\u80fd\u770b\u7684\u683c\u5f0f<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">IDE \u4e5f\u4e00\u6837\u80fd\u4e00\u952e\u751f\u6210 <code>toString()<\/code>\u3002\u5efa\u8bae\u6bcf\u4e2a\u5b9e\u4f53\u7c7b\uff08POJO\u3001DTO\u3001VO\uff09\u90fd\u52a0\u4e0a\u2014\u2014<strong>\u5199\u65e5\u5fd7\u3001\u8c03\u8bd5\u3001\u6392\u67e5\u95ee\u9898\u7684\u65f6\u5019\uff0c\u6bcf\u4e00\u6761\u65e5\u5fd7\u90fd\u80fd\u770b\u6e05\u5bf9\u8c61\u7684\u5185\u5bb9\uff0c\u7701\u591a\u5c11\u65f6\u95f4<\/strong>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001getClass()\u2014\u2014\u8fd0\u884c\u65f6\u7684\u7c7b\u578b\u4fe1\u606f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>getClass()<\/code> \u8fd4\u56de\u7684\u662f\u8fd9\u4e2a\u5bf9\u8c61\u7684 <strong>Class \u5bf9\u8c61<\/strong>\uff0c\u91cc\u9762\u5305\u542b\u4e86\u7c7b\u7684\u5b8c\u6574\u4fe1\u606f\u2014\u2014\u7c7b\u540d\u3001\u65b9\u6cd5\u3001\u5b57\u6bb5\u3001\u6ce8\u89e3\u7b49\u7b49\u3002\u5b83\u662f Java \u53cd\u5c04\u7684\u5165\u53e3\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Student s = new Student();\nClass&lt;?&gt; clazz = s.getClass();\n\nSystem.out.println(clazz.getName());          \/\/ com.example.Student\nSystem.out.println(clazz.getSimpleName());    \/\/ Student\nSystem.out.println(clazz.getSuperclass());    \/\/ class java.lang.Object<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u7bc7\u5199 <code>equals<\/code> \u7684\u65f6\u5019\u6211\u4eec\u7528 <code>getClass() != obj.getClass()<\/code> \u505a\u7c7b\u578b\u68c0\u67e5\uff0c\u8fd9\u5c31\u662f <code>getClass()<\/code> \u6700\u5178\u578b\u7684\u7528\u6cd5\u2014\u2014\u5224\u65ad\u4e24\u4e2a\u5bf9\u8c61\u662f\u4e0d\u662f\u540c\u4e00\u4e2a\u7c7b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u8865\u5145\u4e00\u4e2a\u77e5\u8bc6\u70b9\uff1a<code>instanceof<\/code> \u548c <code>getClass()<\/code> \u7684\u533a\u522b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Animal {}\nclass Dog extends Animal {}\nclass Cat extends Animal {}\n\nAnimal dog = new Dog();\n\nSystem.out.println(dog instanceof Dog);      \/\/ true\nSystem.out.println(dog instanceof Animal);   \/\/ true\uff08\u56e0\u4e3a Dog \u7ee7\u627f Animal\uff09\nSystem.out.println(dog.getClass() == Dog.class);   \/\/ true\nSystem.out.println(dog.getClass() == Animal.class); \/\/ false\uff08\u8fd0\u884c\u65f6\u7c7b\u578b\u662f Dog\uff09<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>instanceof<\/code> \u68c0\u67e5\u7684\u662f\u300c\u662f\u4e0d\u662f\u8fd9\u4e2a\u7c7b\u578b\u6216\u5b50\u7c7b\u578b\u300d\uff1b<code>getClass() == xxx.class<\/code> \u68c0\u67e5\u7684\u662f\u300c\u662f\u4e0d\u662f<strong>\u7cbe\u786e\u5730<\/strong>\u8fd9\u4e2a\u7c7b\u578b\u300d\u3002\u9762\u8bd5\u7ecf\u5e38\u8003\u8fd9\u4e2a\u533a\u522b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001clone()\u2014\u2014\u5bf9\u8c61\u7684\u62f7\u8d1d<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u60f3\u590d\u5236\u4e00\u4e2a\u5bf9\u8c61\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Student s1 = new Student(\"\u5f20\u4e09\", 20);\nStudent s2 = s1;  \/\/ \u8fd9\u6839\u672c\u4e0d\u662f\u590d\u5236\u2014\u2014s2 \u548c s1 \u6307\u5411\u540c\u4e00\u4e2a\u5bf9\u8c61\uff01\ns2.setName(\"\u674e\u56db\");\nSystem.out.println(s1.getName()); \/\/ \u674e\u56db \u2014\u2014 s1 \u4e5f\u88ab\u6539\u4e86<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8981\u771f\u6b63\u590d\u5236\u4e00\u4e2a\u5bf9\u8c61\uff0cObject \u63d0\u4f9b\u4e86 <code>clone()<\/code> \u65b9\u6cd5\u3002\u4f46\u5b83\u6709\u51e0\u4e2a\u9650\u5236\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f60\u7684\u7c7b\u5fc5\u987b\u5b9e\u73b0 <code>Cloneable<\/code> \u63a5\u53e3\uff08\u6807\u8bb0\u63a5\u53e3\uff0c\u91cc\u9762\u6ca1\u6709\u65b9\u6cd5\uff09<\/li>\n\n\n\n<li><code>clone()<\/code> \u662f <code>protected<\/code> \u7684\uff0c\u4f60\u9700\u8981\u5728\u5b50\u7c7b\u4e2d<strong>\u91cd\u5199\u4e3a public<\/strong><\/li>\n\n\n\n<li>\u9ed8\u8ba4\u7684 <code>clone()<\/code> \u662f<strong>\u6d45\u62f7\u8d1d<\/strong>\u2014\u2014\u53ea\u80fd\u590d\u5236\u57fa\u672c\u7c7b\u578b\uff0c\u5f15\u7528\u7c7b\u578b\u53ea\u590d\u5236\u5f15\u7528<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>public class Student implements Cloneable {\n    private String name;\n    private int age;\n    private Address address;  \/\/ \u5f15\u7528\u7c7b\u578b\n\n    public Student(String name, int age, Address address) {\n        this.name = name;\n        this.age = age;\n        this.address = address;\n    }\n\n    @Override\n    public Student clone() {\n        try {\n            return (Student) super.clone();  \/\/ \u6d45\u62f7\u8d1d\n        } catch (CloneNotSupportedException e) {\n            throw new AssertionError();\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d45\u62f7\u8d1d\u7684\u95ee\u9898\uff1a\u5982\u679c <code>address<\/code> \u662f\u4e2a\u5f15\u7528\u7c7b\u578b\uff0c\u4e24\u4e2a Student \u7684 <code>address<\/code> \u6307\u5411\u540c\u4e00\u4e2a\u5730\u5740\u5bf9\u8c61\u2014\u2014\u6539\u4e00\u4e2a\u53e6\u4e00\u4e2a\u4e5f\u8ddf\u7740\u53d8\u3002\u8981\u300c\u6df1\u62f7\u8d1d\u300d\u9700\u8981\u624b\u52a8\u590d\u5236\u6240\u6709\u5f15\u7528\u5b57\u6bb5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Override\npublic Student clone() {\n    try {\n        Student cloned = (Student) super.clone();\n        cloned.address = this.address.clone();  \/\/ \u5f15\u7528\u5b57\u6bb5\u4e5f\u590d\u5236\n        return cloned;\n    } catch (CloneNotSupportedException e) {\n        throw new AssertionError();\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bf4\u5b9e\u8bdd\uff0cJava \u7684 <code>clone()<\/code> \u673a\u5236\u8bbe\u8ba1\u5f97\u6709\u70b9\u522b\u626d\u2014\u2014\u53c8\u662f <code>Cloneable<\/code> \u63a5\u53e3\uff08\u6807\u8bb0\u800c\u5df2\uff09\uff0c\u53c8\u662f <code>protected<\/code> \u65b9\u6cd5\uff0c\u8fd8\u8981\u629b\u5f02\u5e38\u2026\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u5728\u66f4\u63a8\u8350\u7528<strong>\u62f7\u8d1d\u6784\u9020\u5668<\/strong>\u6216\u8005<strong>\u5de5\u5382\u65b9\u6cd5<\/strong>\u6765\u4ee3\u66ff <code>clone()<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u62f7\u8d1d\u6784\u9020\u5668\npublic Student(Student other) {\n    this.name = other.name;\n    this.age = other.age;\n    this.address = new Address(other.address); \/\/ \u6df1\u62f7\u8d1d\n}\n\n\/\/ \u4f7f\u7528\nStudent s2 = new Student(s1);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6e05\u723d\uff0c\u53ef\u63a7\uff0c\u4e0d\u4f9d\u8d56 <code>Cloneable<\/code> \u8fd9\u79cd\u602a\u80ce\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001finalize()\u2014\u2014\u522b\u78b0\u8fd9\u4e2a\u65b9\u6cd5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>finalize()<\/code> \u662f Object \u7c7b\u4e2d\u7684\u4e00\u4e2a\u65b9\u6cd5\uff0cGC \u5728\u56de\u6536\u5bf9\u8c61\u4e4b\u524d\u4f1a\u8c03\u7528\u5b83\u4e00\u6b21\u3002\u542c\u8d77\u6765\u597d\u50cf\u5f88\u7f8e\u597d\u2014\u2014\u53ef\u4ee5\u5728\u5bf9\u8c61\u88ab\u56de\u6536\u524d\u91ca\u653e\u8d44\u6e90\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u5b9e\u9645\u4e0a\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b83<strong>\u4ec0\u4e48\u65f6\u5019\u88ab\u8c03\u7528\u4e0d\u786e\u5b9a<\/strong>\u2014\u2014GC \u7684\u65f6\u673a\u4e0d\u5f52\u4f60\u63a7\u5236<\/li>\n\n\n\n<li>\u5b83<strong>\u53ef\u80fd\u6839\u672c\u4e0d\u88ab\u8c03\u7528<\/strong>\u2014\u2014\u7a0b\u5e8f\u9000\u51fa\u65f6\u5982\u679c GC \u6ca1\u8dd1\uff0c<code>finalize()<\/code> \u5c31\u6c38\u8fdc\u4e0d\u4f1a\u6267\u884c<\/li>\n\n\n\n<li>\u6027\u80fd\u5dee\u2014\u2014\u4f1a\u663e\u8457\u62d6\u6162 GC \u901f\u5ea6<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Java 9 \u5c31\u5df2\u7ecf\u6807\u8bb0\u4e3a <code>@Deprecated(since=\"9\")<\/code> \u4e86\u3002\u73b0\u5728\u8981\u91ca\u653e\u8d44\u6e90\u5c31\u7528 <code>try-with-resources<\/code> \u6216\u8005 <code>AutoCloseable<\/code> \u63a5\u53e3\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u2705 \u6b63\u786e\u505a\u6cd5\ntry (FileInputStream fis = new FileInputStream(\"test.txt\")) {\n    \/\/ \u4f7f\u7528 fis...\n} \/\/ \u81ea\u52a8\u5173\u95ed\uff0c\u4e0d\u9700\u8981 finalize\n\n\/\/ \u274c \u522b\u7528 finalize<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001notify() \/ notifyAll() \/ wait()<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e09\u4e2a\u65b9\u6cd5\u662f <strong>\u591a\u7ebf\u7a0b\u901a\u4fe1<\/strong> \u7528\u7684\uff0c\u4e0d\u6d89\u53ca\u591a\u7ebf\u7a0b\u7684\u65f6\u5019\u57fa\u672c\u7528\u4e0d\u5230\u3002\u7b49\u6211\u4eec\u8bb2\u5230\u591a\u7ebf\u7a0b\u90a3\u90e8\u5206\u7684\u65f6\u5019\u518d\u5c55\u5f00\u3002\u5148\u77e5\u9053\u6709\u8fd9\u4e48\u51e0\u4e2a\u65b9\u6cd5\u5c31\u884c\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u4e09\u5144\u5f1f\u603b\u7ed3<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u65b9\u6cd5<\/th><th>\u9ed8\u8ba4\u884c\u4e3a<\/th><th>\u5efa\u8bae<\/th><\/tr><\/thead><tbody><tr><td><code>toString()<\/code><\/td><td><code>\u7c7b\u540d@\u54c8\u5e0c\u503c\u5341\u516d\u8fdb\u5236<\/code><\/td><td><strong>\u5f3a\u70c8\u5efa\u8bae\u91cd\u5199<\/strong>\uff0cIDE \u751f\u6210\u5373\u53ef<\/td><\/tr><tr><td><code>getClass()<\/code><\/td><td>\u8fd4\u56de\u8fd0\u884c\u65f6\u7684 <code>Class&lt;?&gt;<\/code> \u5bf9\u8c61<\/td><td>\u76f4\u63a5\u4f7f\u7528\uff0c\u522b\u91cd\u5199\uff08<code>final<\/code> \u65b9\u6cd5\u91cd\u5199\u4e0d\u4e86\uff09<\/td><\/tr><tr><td><code>clone()<\/code><\/td><td>\u6d45\u62f7\u8d1d\uff0c\u9700\u5b9e\u73b0 <code>Cloneable<\/code><\/td><td>\u4f18\u5148\u7528\u62f7\u8d1d\u6784\u9020\u5668\u66ff\u4ee3<\/td><\/tr><tr><td><code>finalize()<\/code><\/td><td>GC \u524d\u8c03\u7528\u4e00\u6b21<\/td><td><strong>\u522b\u7528<\/strong>\uff0cJava 9 \u5df2\u5f03\u7528<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001Object \u65b9\u6cd5\u4e4b\u5916\u7684\u8865\u5145\uff1aObjects \u5de5\u5177\u7c7b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ddf Object \u7c7b\u76f8\u4f3c\u4f46\u4e0d\u76f8\u540c\u7684\u662f <code>java.util.Objects<\/code>\u2014\u2014\u5b83\u662f\u4e00\u4e2a\u5de5\u5177\u7c7b\uff08\u5168\u662f\u9759\u6001\u65b9\u6cd5\uff09\uff0c\u7528\u6765\u5904\u7406\u5bf9\u8c61\u76f8\u5173\u7684\u64cd\u4f5c\u3002\u524d\u9762\u6211\u4eec\u5df2\u7ecf\u7528\u8fc7 <code>Objects.equals()<\/code> \u548c <code>Objects.hash()<\/code>\uff0c\u8fd9\u91cc\u518d\u8865\u5145\u51e0\u4e2a\u597d\u7528\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>String s = null;\n\n\/\/ Objects.toString() \u2014\u2014 \u5bf9\u8c61\u8f6c\u5b57\u7b26\u4e32\uff0cnull \u5b89\u5168\nSystem.out.println(Objects.toString(s));         \/\/ \"null\"\nSystem.out.println(Objects.toString(s, \"\u9ed8\u8ba4\u503c\")); \/\/ \"\u9ed8\u8ba4\u503c\"\n\n\/\/ Objects.requireNonNull() \u2014\u2014 \u5feb\u901f\u5224\u7a7a\uff0c\u8fd4\u56de\u975e\u7a7a\u503c\u6216\u629b\u5f02\u5e38\npublic Student(String name) {\n    this.name = Objects.requireNonNull(name, \"\u59d3\u540d\u4e0d\u80fd\u4e3a\u7a7a\");\n}\n\n\/\/ Objects.isNull() \/ nonNull() \u2014\u2014 \u5224\u7a7a\nif (Objects.isNull(s)) {\n    System.out.println(\"s \u662f null\");\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e9b\u5de5\u5177\u65b9\u6cd5\u8ba9\u4ee3\u7801\u66f4\u7b80\u6d01\uff0c\u800c\u4e14\u907f\u514d\u4e86\u7a7a\u6307\u9488\u2014\u2014\u5e73\u65f6\u5199\u4ee3\u7801\u591a\u7559\u610f\u4e00\u4e0b java.util \u5305\u4e0b\u7684\u5de5\u5177\u7c7b\uff0c\u80fd\u7701\u4e0d\u5c11\u4e8b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u5c0f\u7ed3<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>toString()<\/code> \u63a8\u8350\u6bcf\u4e2a\u5b9e\u4f53\u7c7b\u90fd\u91cd\u5199\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387<\/li>\n\n\n\n<li><code>getClass()<\/code> \u83b7\u53d6\u8fd0\u884c\u65f6 Class \u4fe1\u606f\uff0c\u53cd\u5c04\u7684\u5165\u53e3<\/li>\n\n\n\n<li><code>clone()<\/code> \u9ed8\u8ba4\u6d45\u62f7\u8d1d\uff0c\u6709\u5751\uff1b\u66f4\u63a8\u8350\u62f7\u8d1d\u6784\u9020\u5668<\/li>\n\n\n\n<li><code>finalize()<\/code> \u5df2\u8fc7\u65f6\uff0c\u522b\u78b0<\/li>\n\n\n\n<li><code>Objects<\/code> \u5de5\u5177\u7c7b\u63d0\u4f9b\u4e86\u4e00\u5927\u5806 <code>null<\/code> \u5b89\u5168\u7684\u64cd\u4f5c\u65b9\u6cd5\uff0c\u8bb0\u5f97\u7528<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Object \u7c7b\u4e24\u7bc7\u8bb2\u5b8c\u3002\u4e0b\u4e00\u7bc7\u6211\u4eec\u804a\u6700\u540e\u4e00\u4e2a\u5b50\u5206\u7c7b\u2014\u2014<strong>\u679a\u4e3e\u4e0e\u5305\u88c5\u7c7b<\/strong>\u3002<code>enum<\/code> \u5173\u952e\u5b57\u3001Integer \u7f13\u5b58\u6c60\u3001\u81ea\u52a8\u88c5\u7bb1\/\u62c6\u7bb1\u2026\u2026\u5168\u662f\u9762\u8bd5\u5e38\u5ba2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7bc7\u804a\u4e86 equals \u548c hashCode\uff0c\u8fd9\u4e24\u4e2a\u662f Object \u7c7b\u4e2d\u88ab\u91cd\u5199\u5f97\u6700\u591a\u7684\u65b9\u6cd5\u3002\u8fd9\u7bc7\u6211\u4eec\u628a\u5269\u4e0b\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[71,10],"tags":[108,96,106,107,105],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-07-object-class","category-javase","tag-108","tag-96","tag-clone","tag-finalize","tag-tostring"],"_links":{"self":[{"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":2,"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":295,"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/posts\/289\/revisions\/295"}],"wp:attachment":[{"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssjava.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}