{"id":203333,"date":"2025-05-22T08:00:24","date_gmt":"2025-05-22T00:00:24","guid":{"rendered":"https:\/\/server.hk\/cnblog\/203333\/"},"modified":"2025-05-22T08:00:24","modified_gmt":"2025-05-22T00:00:24","slug":"java-%e4%b8%ad-object-%e7%b1%bb%e6%9c%89%e5%93%aa%e4%ba%9b%e6%96%b9%e6%b3%95%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/203333\/","title":{"rendered":"Java \u4e2d Object \u7c7b\u6709\u54ea\u4e9b\u65b9\u6cd5\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Java \u4e2d Object \u7c7b\u6709\u54ea\u4e9b\u65b9\u6cd5\uff1f<\/h1>\n<p>\u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6587\u7ae0\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300aJava \u4e2d Object \u7c7b\u6709\u54ea\u4e9b\u65b9\u6cd5\uff1f\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241105\/173077565367298a653315b.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>java \u4e2d Object \u7c7b\u7684\u4e3b\u8981\u65b9\u6cd5<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong>2020-9-10\uff1ajava \u91cc Object \u7c7b\u6709\u54ea\u4e9b\u65b9\u6cd5\uff1f<\/p>\n<p><strong>\u7b54\u6848\uff1a<\/strong><\/p>\n<p>Object \u7c7b\u662f Java \u8bed\u8a00\u4e2d\u6240\u6709\u7c7b\u7684\u57fa\u7c7b\u3002\u56e0\u6b64\uff0c\u5b83\u5305\u542b\u6240\u6709 Java \u7c7b\u5171\u4eab\u7684\u57fa\u672c\u65b9\u6cd5\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\u975e\u5e38\u6709\u7528\u3002\u8981\u4e86\u89e3 Object \u7c7b\u7684\u6240\u6709\u65b9\u6cd5\uff0c\u6700\u597d\u7684\u529e\u6cd5\u662f\u76f4\u63a5\u67e5\u770b Java \u5f00\u53d1\u5de5\u5177\u5305 (JDK) \u6e90\u4ee3\u7801\u3002<\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\u67e5\u770b JDK \u6e90\u4ee3\u7801\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5 JDK\u3002<\/li>\n<li>\u627e\u5230 Object.java \u6587\u4ef6\uff08\u901a\u5e38\u4f4d\u4e8eJDK \u5b89\u88c5\u76ee\u5f55\u7684 src.java.lang \u5305\u4e2d\uff09\u3002<\/li>\n<li>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6216 IDE \u6253\u5f00 Object.java \u6587\u4ef6\u3002<\/li>\n<\/ol>\n<p>Object \u7c7b\u7684\u6e90\u4ee3\u7801\u4e2d\u5305\u542b\u4e86\u6240\u6709\u53ef\u7528\u65b9\u6cd5\u7684\u5217\u8868\u548c\u63cf\u8ff0\u3002\u8fd9\u4e9b\u65b9\u6cd5\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>hashCode()\uff1a<\/strong>\u8fd4\u56de\u5bf9\u8c61\u7684\u54c8\u5e0c\u7801\u3002<\/li>\n<li><strong>equals()\uff1a<\/strong>\u6bd4\u8f83\u4e24\u4e2a\u5bf9\u8c61\u662f\u5426\u76f8\u7b49\u3002<\/li>\n<li><strong>toString()\uff1a<\/strong>\u8fd4\u56de\u5bf9\u8c61\u7684\u5b57\u7b26\u4e32\u8868\u793a\u5f62\u5f0f\u3002<\/li>\n<li><strong>getClass()\uff1a<\/strong>\u8fd4\u56de\u8868\u793a\u6b64\u5bf9\u8c61\u6240\u5c5e\u7c7b\u7684 Class \u5bf9\u8c61\u3002<\/li>\n<li><strong>notify()\uff1a<\/strong>\u5524\u9192\u7b49\u5f85\u6b64\u5bf9\u8c61\u76d1\u89c6\u5668\u9501\u5b9a\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\u7ebf\u7a0b\u3002<\/li>\n<li><strong>notifyAll()\uff1a<\/strong>\u5524\u9192\u7b49\u5f85\u6b64\u5bf9\u8c61\u76d1\u89c6\u5668\u9501\u5b9a\u7684\u6240\u6709\u7ebf\u7a0b\u3002<\/li>\n<li><strong>wait()\uff1a<\/strong>\u4f7f\u8c03\u7528\u7ebf\u7a0b\u8fdb\u5165\u7b49\u5f85\u72b6\u6001\uff0c\u76f4\u5230\u5f53\u524d\u7ebf\u7a0b\u5df2\u88ab\u5176\u4ed6\u7ebf\u7a0b\u4e2d\u65ad\u6216\u5524\u9192\u3002<\/li>\n<li><strong>wait(long timeoutMillis)\uff1a<\/strong>\u4f7f\u8c03\u7528\u7ebf\u7a0b\u8fdb\u5165\u7b49\u5f85\u72b6\u6001\uff0c\u76f4\u5230\u5f53\u524d\u7ebf\u7a0b\u88ab\u4e2d\u65ad\u6216\u5524\u9192\uff0c\u6216\u6307\u5b9a\u8d85\u65f6\u65f6\u95f4\u5df2\u8fc7\u3002<\/li>\n<li><strong>wait(long timeoutMillis, int nanos)\uff1a<\/strong>\u4f7f\u8c03\u7528\u7ebf\u7a0b\u8fdb\u5165\u7b49\u5f85\u72b6\u6001\uff0c\u76f4\u5230\u5f53\u524d\u7ebf\u7a0b\u88ab\u4e2d\u65ad\u6216\u5524\u9192\uff0c\u6216\u6307\u5b9a\u8d85\u65f6\u65f6\u95f4\u5df2\u8fc7\u3002<\/li>\n<\/ul>\n<p>\u4eca\u5929\u5173\u4e8e\u300aJava \u4e2d Object \u7c7b\u6709\u54ea\u4e9b\u65b9\u6cd5\uff1f\u300b\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u662f\u4e0d\u662f\u5b66\u8d77\u6765\u4e00\u76ee\u4e86\u7136\uff01\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u5185\u5bb9\u8bf7\u5173\u6ce8\u516c\u4f17\u53f7\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java \u4e2d Object \u7c7b\u6709&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-203333","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=203333"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/203333\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=203333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=203333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=203333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}