{"id":202938,"date":"2025-05-22T08:30:25","date_gmt":"2025-05-22T00:30:25","guid":{"rendered":"https:\/\/server.hk\/cnblog\/202938\/"},"modified":"2025-05-22T08:30:25","modified_gmt":"2025-05-22T00:30:25","slug":"java%e5%87%bd%e6%95%b0%e9%87%8d%e8%bd%bd%e7%9a%84%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5%e4%b8%8e%e5%8f%8d%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/202938\/","title":{"rendered":"Java\u51fd\u6570\u91cd\u8f7d\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u53cd\u6a21\u5f0f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Java\u51fd\u6570\u91cd\u8f7d\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u53cd\u6a21\u5f0f<\/h1>\n<p>\u6587\u7ae0\u5c0f\u767d\u4e00\u679a\uff0c\u6b63\u5728\u4e0d\u65ad\u5b66\u4e60\u79ef\u7d2f\u77e5\u8bc6\uff0c\u73b0\u5c06\u5b66\u4e60\u5230\u7684\u77e5\u8bc6\u8bb0\u5f55\u4e00\u4e0b\uff0c\u4e5f\u662f\u5c06\u6211\u7684\u6240\u5f97\u5206\u4eab\u7ed9\u5927\u5bb6\uff01\u800c\u4eca\u5929\u8fd9\u7bc7\u6587\u7ae0\u300aJava\u51fd\u6570\u91cd\u8f7d\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u53cd\u6a21\u5f0f\u300b\u5e26\u5927\u5bb6\u6765\u4e86\u89e3\u4e00\u4e0b##content_title##\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u4ece\u800c\u5f25\u8865\u81ea\u5df1\u7684\u4e0d\u8db3\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><\/p>\n<p>Java \u51fd\u6570\u91cd\u8f7d\u6700\u4f73\u5b9e\u8df5\uff1a\u4fdd\u6301\u53c2\u6570\u7b80\u6d01\u3001\u4f7f\u7528\u6709\u610f\u4e49\u7684\u540d\u79f0\u3001\u6ce8\u91ca\u5dee\u5f02\u3001\u907f\u514d\u8fc7\u5ea6\u91cd\u8f7d\u3001\u786e\u4fdd\u903b\u8f91\u4e00\u81f4\u3002\u53cd\u6a21\u5f0f\uff1a\u53c2\u6570\u76f8\u4f3c\u3001\u540d\u79f0\u4e0d\u6e05\u6670\u3001\u7f3a\u5c11\u6ce8\u91ca\u3001\u8fc7\u5ea6\u91cd\u8f7d\u3001\u903b\u8f91\u4e0d\u4e00\u81f4\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241027\/1730001887671dbbdf9946b.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>Java \u51fd\u6570\u91cd\u8f7d\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u53cd\u6a21\u5f0f<\/strong><\/p>\n<p><strong>\u7b80\u4ecb<\/strong><br \/>\u51fd\u6570\u91cd\u8f7d\u5141\u8bb8\u6211\u4eec\u521b\u5efa\u5177\u6709\u76f8\u540c\u540d\u79f0\u4f46\u4e0d\u540c\u53c2\u6570\u5217\u8868\u7684\u591a\u4e2a\u51fd\u6570\u3002\u8fd9\u5728\u7f16\u5199\u53ef\u91cd\u7528\u7684\u4ee3\u7801\u548c\u8868\u8fbe\u4ee3\u7801\u610f\u56fe\u65f6\u975e\u5e38\u6709\u7528\u3002\u4f46\u662f\uff0c\u5982\u679c\u4e0d\u52a0\u4ee5\u9650\u5236\uff0c\u51fd\u6570\u91cd\u8f7d\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4ee3\u7801\u5e93\u81a8\u80c0\u548c\u7ef4\u62a4\u56f0\u96be\u3002<\/p>\n<p><strong>\u6700\u4f73\u5b9e\u8df5<\/strong><\/p>\n<ul>\n<li><strong>\u4fdd\u6301\u53c2\u6570\u5217\u8868\u7b80\u6d01\uff1a<\/strong>\u907f\u514d\u5728\u91cd\u8f7d\u51fd\u6570\u4e2d\u4f7f\u7528\u5197\u957f\u7684\u6216\u76f8\u4f3c\u7684\u53c2\u6570\u5217\u8868\u3002\u8fd9\u4f1a\u4f7f\u4ee3\u7801\u96be\u4ee5\u9605\u8bfb\u548c\u7406\u89e3\u3002<\/li>\n<li><strong>\u4f7f\u7528\u6709\u610f\u4e49\u7684\u53c2\u6570\u540d\u79f0\uff1a<\/strong>\u53c2\u6570\u540d\u79f0\u5e94\u6e05\u6670\u5730\u4f20\u8fbe\u5b83\u4eec\u7684\u4f5c\u7528\uff0c\u4ece\u800c\u51cf\u5c11\u731c\u6d4b\u548c\u6df7\u6dc6\u3002<\/li>\n<li><strong>\u4f7f\u7528\u6ce8\u91ca\u8bf4\u660e\u53c2\u6570\u5dee\u5f02\uff1a<\/strong>\u5f53\u51fd\u6570\u91cd\u8f7d\u6709\u591a\u4e2a\u7c7b\u4f3c\u7684\u53c2\u6570\u65f6\uff0c\u4f7f\u7528\u6ce8\u91ca\u89e3\u91ca\u5b83\u4eec\u4e4b\u95f4\u7684\u5dee\u5f02\u3002<\/li>\n<li><strong>\u907f\u514d\u8fc7\u5ea6\u91cd\u8f7d\uff1a<\/strong>\u8d85\u8fc7 3-4 \u4e2a\u91cd\u8f7d\u51fd\u6570\u53ef\u80fd\u4f1a\u4f7f\u4ee3\u7801\u96be\u4ee5\u7ef4\u62a4\u3002\u8003\u8651\u4f7f\u7528\u53ef\u53d8\u53c2\u6570\u6216\u53ef\u9009\u9879\u6765\u51cf\u5c11\u91cd\u8f7d\u6570\u91cf\u3002<\/li>\n<li><strong>\u786e\u4fdd\u91cd\u8f7d\u51fd\u6570\u903b\u8f91\u4e00\u81f4\uff1a<\/strong>\u6240\u6709\u91cd\u8f7d\u51fd\u6570\u5e94\u6267\u884c\u76f8\u540c\u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u5373\u4f7f\u6709\u7ec6\u5fae\u5dee\u522b\u3002<\/li>\n<\/ul>\n<p><strong>\u53cd\u6a21\u5f0f<\/strong><\/p>\n<ul>\n<li><strong>\u53c2\u6570\u5217\u8868\u76f8\u4f3c\u5ea6\uff1a<\/strong>\u907f\u514d\u521b\u5efa\u5177\u6709\u9ad8\u5ea6\u76f8\u4f3c\u53c2\u6570\u5217\u8868\u7684\u91cd\u8f7d\u51fd\u6570\u3002\u8fd9\u4f1a\u5bfc\u81f4\u6df7\u4e71\u548c\u6f5c\u5728\u9519\u8bef\u3002<\/li>\n<li><strong>\u53c2\u6570\u540d\u79f0\u4e0d\u6e05\u6670\uff1a<\/strong>\u4f7f\u7528\u901a\u7528\u6216\u6a21\u7cca\u7684\u53c2\u6570\u540d\u79f0\u4f1a\u4f7f\u91cd\u8f7d\u51fd\u6570\u96be\u4ee5\u533a\u5206\u3002<\/li>\n<li><strong>\u7f3a\u5c11\u6ce8\u91ca\uff1a<\/strong>\u4e0d\u6ce8\u91ca\u53c2\u6570\u5dee\u5f02\u4f1a\u589e\u52a0\u7ef4\u62a4\u9519\u8bef\u7684\u53ef\u80fd\u6027\u3002<\/li>\n<li><strong>\u8fc7\u5ea6\u91cd\u8f7d\uff1a<\/strong>\u5927\u91cf\u4f7f\u7528\u91cd\u8f7d\u4f1a\u5bfc\u81f4\u4ee3\u7801\u81a8\u80c0\u548c\u7406\u89e3\u4e0a\u7684\u56f0\u96be\u3002<\/li>\n<li><strong>\u903b\u8f91\u4e0d\u4e00\u81f4\uff1a<\/strong>\u91cd\u8f7d\u51fd\u6570\u7684\u903b\u8f91\u5e94\u4fdd\u6301\u4e00\u81f4\uff0c\u5426\u5219\u4f1a\u4ea7\u751f\u610f\u5916\u884c\u4e3a\u3002<\/li>\n<\/ul>\n<p><strong>\u5b9e\u6218<\/strong><\/p>\n<p>\u8003\u8651\u4ee5\u4e0b\u793a\u4f8b\uff1a<\/p>\n<pre>public void print(int a) {\n    System.out.println(\"int: \" + a);\n}\n\npublic void print(long a) {\n    System.out.println(\"long: \" + a);\n}<\/pre>\n<p>\u8fd9\u662f\u4e00\u4e2a\u51fd\u6570\u91cd\u8f7d\u7684\u826f\u597d\u793a\u4f8b\u3002\u53c2\u6570\u5217\u8868\u7b80\u6d01\u4e14\u6709\u610f\u4e49\uff0c\u903b\u8f91\u4e00\u81f4\u3002<\/p>\n<p><strong>\u76f8\u53cd<\/strong>\uff0c\u4ee5\u4e0b\u793a\u4f8b\u662f\u4e0d\u826f\u7684\u51fd\u6570\u91cd\u8f7d\uff1a<\/p>\n<pre>public void print(int a) {\n    System.out.println(\"print int: \" + a);\n}\n\npublic void print(int a, String b) {\n    System.out.println(\"print int and string: \" + a + \", \" + b);\n}\n\npublic void print(String a) {\n    System.out.println(\"print string: \" + a);\n}<\/pre>\n<p>\u8fd9\u4e9b\u91cd\u8f7d\u51fd\u6570\u53c2\u6570\u5217\u8868\u76f8\u4f3c\uff0c\u540d\u79f0\u4ee4\u4eba\u56f0\u60d1\uff0c\u5e76\u4e14\u903b\u8f91\u4e0d\u4e00\u81f4\u3002\u8fd9\u4f1a\u589e\u52a0\u9519\u8bef\u548c\u7406\u89e3\u56f0\u96be\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u672c\u6587\u5230\u6b64\u7ed3\u675f\uff0c\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u300aJava\u51fd\u6570\u91cd\u8f7d\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u53cd\u6a21\u5f0f\u300b\uff0c\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01\u5173\u6ce8\u516c\u4f17\u53f7\uff0c\u7ed9\u5927\u5bb6\u5206\u4eab\u66f4\u591a\u6587\u7ae0\u77e5\u8bc6\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u51fd\u6570\u91cd\u8f7d\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u53cd\u6a21&#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-202938","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/202938","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=202938"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/202938\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=202938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=202938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=202938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}