{"id":39942,"date":"2024-11-26T13:59:51","date_gmt":"2024-11-26T05:59:51","guid":{"rendered":"https:\/\/fwq.ai\/blog\/39942\/"},"modified":"2024-11-26T13:59:51","modified_gmt":"2024-11-26T05:59:51","slug":"%e6%80%8e%e4%b9%88%e6%8a%8a%e6%95%b0%e7%bb%84%e5%af%b9%e8%b1%a1%e4%bc%a0%e8%bf%87%e5%8e%bbjava","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/39942\/","title":{"rendered":"\u600e\u4e48\u628a\u6570\u7ec4\u5bf9\u8c61\u4f20\u8fc7\u53bbjava"},"content":{"rendered":"<blockquote><p>\n  \u5c06\u6570\u7ec4\u5bf9\u8c61\u4f20\u9012\u7ed9 java \u65b9\u6cd5\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u4f5c\u4e3a\u4e00\u4e2a\u53c2\u6570\uff0c\u6216\u4f5c\u4e3a\u4e00\u4e2a\u8fd4\u56de\u503c\u3002\u8981\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff0c\u8bf7\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u53c2\u6570\u7c7b\u578b\uff0c\u5e76\u5728\u8c03\u7528\u65f6\u5c06\u5176\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u3002\u8981\u4f5c\u4e3a\u8fd4\u56de\u503c\u4f20\u9012\uff0c\u8bf7\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u8fd4\u56de\u7c7b\u578b\uff0c\u5e76\u5728\u8c03\u7528\u65f6\u5c06\u5176\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202411\/17\/2024111713332098836.jpg\" class=\"aligncenter\" title=\"\u600e\u4e48\u628a\u6570\u7ec4\u5bf9\u8c61\u4f20\u8fc7\u53bbjava\u63d2\u56fe\" alt=\"\u600e\u4e48\u628a\u6570\u7ec4\u5bf9\u8c61\u4f20\u8fc7\u53bbjava\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f20\u9012\u7ed9 Java \u65b9\u6cd5<\/strong><\/p>\n<p>\u5728 Java \u4e2d\uff0c\u4f20\u9012\u6570\u7ec4\u5bf9\u8c61\u53ef\u4ee5\u91c7\u7528\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\uff1a\u4f5c\u4e3a\u53c2\u6570\u6216\u4f5c\u4e3a\u8fd4\u56de\u503c\u3002<\/p>\n<p><strong>\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u6570\u7ec4\u5bf9\u8c61<\/strong><\/p>\n<p>\u8981\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff0c\u9700\u8981\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u53c2\u6570\u7c7b\u578b\u3002\u4f8b\u5982\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>public void myMethod(int[] array) {\n  \/\/ \u5bf9\u6570\u7ec4\u8fdb\u884c\u64cd\u4f5c\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8c03\u7528\u6b64\u65b9\u6cd5\u65f6\uff0c\u53ef\u4ee5\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff1a<\/p>\n<pre>int[] myArray = {1, 2, 3};\nmyMethod(myArray);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u4f5c\u4e3a\u8fd4\u56de\u503c\u4f20\u9012\u6570\u7ec4\u5bf9\u8c61<\/strong><\/p>\n<p>\u8981\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f5c\u4e3a\u8fd4\u56de\u503c\uff0c\u9700\u8981\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u8fd4\u56de\u7c7b\u578b\u3002\u4f8b\u5982\uff1a<\/p>\n<pre>public int[] myMethod() {\n  \/\/ \u521b\u5efa\u5e76\u8fd4\u56de\u4e00\u4e2a\u6570\u7ec4\u5bf9\u8c61\n  return new int[] {1, 2, 3};\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8c03\u7528\u6b64\u65b9\u6cd5\u65f6\uff0c\u53ef\u4ee5\u5c06\u6570\u7ec4\u5bf9\u8c61\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf\uff1a<\/p>\n<pre>int[] myArray = myMethod();<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u628a\u6570\u7ec4\u5bf9\u8c61\u4f20\u8fc7\u53bbjava\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f20\u9012\u7ed9 java \u65b9\u6cd5\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a\u4f5c\u4e3a\u4e00\u4e2a\u53c2\u6570\uff0c\u6216\u4f5c\u4e3a\u4e00\u4e2a\u8fd4\u56de\u503c\u3002\u8981\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff0c\u8bf7\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u53c2\u6570\u7c7b\u578b\uff0c\u5e76\u5728\u8c03\u7528\u65f6\u5c06\u5176\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u3002\u8981\u4f5c\u4e3a\u8fd4\u56de\u503c\u4f20\u9012\uff0c\u8bf7\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u8fd4\u56de\u7c7b\u578b\uff0c\u5e76\u5728\u8c03\u7528\u65f6\u5c06\u5176\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf\u3002 \u5982\u4f55\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f20\u9012\u7ed9 Java \u65b9\u6cd5 \u5728 Java \u4e2d\uff0c\u4f20\u9012\u6570\u7ec4\u5bf9\u8c61\u53ef\u4ee5\u91c7\u7528\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\uff1a\u4f5c\u4e3a\u53c2\u6570\u6216\u4f5c\u4e3a\u8fd4\u56de\u503c\u3002 \u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u6570\u7ec4\u5bf9\u8c61 \u8981\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff0c\u9700\u8981\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u53c2\u6570\u7c7b\u578b\u3002\u4f8b\u5982\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b public void myMethod(int[] array) { \/\/ \u5bf9\u6570\u7ec4\u8fdb\u884c\u64cd\u4f5c } \u767b\u5f55\u540e\u590d\u5236 \u8c03\u7528\u6b64\u65b9\u6cd5\u65f6\uff0c\u53ef\u4ee5\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff1a int[] myArray = {1, 2, 3}; myMethod(myArray); \u767b\u5f55\u540e\u590d\u5236 \u4f5c\u4e3a\u8fd4\u56de\u503c\u4f20\u9012\u6570\u7ec4\u5bf9\u8c61 \u8981\u5c06\u6570\u7ec4\u5bf9\u8c61\u4f5c\u4e3a\u8fd4\u56de\u503c\uff0c\u9700\u8981\u5728\u65b9\u6cd5\u58f0\u660e\u4e2d\u5c06\u6570\u7ec4\u7c7b\u578b\u6307\u5b9a\u4e3a\u8fd4\u56de\u7c7b\u578b\u3002\u4f8b\u5982\uff1a public int[] myMethod() { \/\/ \u521b\u5efa\u5e76\u8fd4\u56de\u4e00\u4e2a\u6570\u7ec4\u5bf9\u8c61 return new int[] {1, 2, 3}; } \u767b\u5f55\u540e\u590d\u5236 \u8c03\u7528\u6b64\u65b9\u6cd5\u65f6\uff0c\u53ef\u4ee5\u5c06\u6570\u7ec4\u5bf9\u8c61\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf\uff1a int[] myArray = myMethod(); \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u628a\u6570\u7ec4\u5bf9\u8c61\u4f20\u8fc7\u53bbjava\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-39942","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/39942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=39942"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/39942\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=39942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=39942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=39942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}