{"id":66786,"date":"2025-05-03T08:58:20","date_gmt":"2025-05-03T00:58:20","guid":{"rendered":"https:\/\/fwq.ai\/blog\/66786\/"},"modified":"2025-05-03T08:58:20","modified_gmt":"2025-05-03T00:58:20","slug":"java%e6%80%8e%e4%b9%88%e8%ae%a1%e7%ae%97%e4%ba%8c%e7%bb%b4%e6%95%b0%e7%bb%84%e9%95%bf%e5%ba%a6-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/66786\/","title":{"rendered":"java\u600e\u4e48\u8ba1\u7b97\u4e8c\u7ef4\u6570\u7ec4\u957f\u5ea6"},"content":{"rendered":"<blockquote><p>\n  \u8981\u8ba1\u7b97 java \u4e2d\u4e8c\u7ef4\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u9996\u5148\u8ba1\u7b97\u884c\u6570\uff0c\u7136\u540e\u8ba1\u7b97\u5217\u6570\u3002\u4f8b\u5982\uff0c{{1, 2, 3}, {4, 5, 6}}\u8fd9\u4e2a\u6570\u7ec4\u6709 2 \u884c\u548c 3 \u5217\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202411\/17\/2024111709575883215.jpg\" class=\"aligncenter\" title=\"java\u600e\u4e48\u8ba1\u7b97\u4e8c\u7ef4\u6570\u7ec4\u957f\u5ea6\u63d2\u56fe\" alt=\"java\u600e\u4e48\u8ba1\u7b97\u4e8c\u7ef4\u6570\u7ec4\u957f\u5ea6\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u8ba1\u7b97 Java \u4e2d\u4e8c\u7ef4\u6570\u7ec4\u7684\u957f\u5ea6<\/strong><\/p>\n<p>\u8981\u8ba1\u7b97 Java \u4e2d\u4e8c\u7ef4\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u8ba1\u7b97\u884c\u6570<\/strong><\/p>\n<p>int rowCount = array.length;<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>2. \u8ba1\u7b97\u5217\u6570<\/strong><\/p>\n<p>int colCount = array[0].length;<\/p>\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n<pre>int[][] array = {\n    {1, 2, 3},\n    {4, 5, 6}\n};\n\nint rowCount = array.length; \/\/ 2\nint colCount = array[0].length; \/\/ 3<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0crowCount \u4e3a 2\uff0c\u8868\u793a\u6570\u7ec4\u6709\u4e24\u884c\uff0ccolCount \u4e3a 3\uff0c\u8868\u793a\u6bcf\u4e00\u884c\u6709 3 \u5217\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fjava\u600e\u4e48\u8ba1\u7b97\u4e8c\u7ef4\u6570\u7ec4\u957f\u5ea6\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8IDCBABY\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u8ba1\u7b97 java \u4e2d\u4e8c\u7ef4\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u9996\u5148\u8ba1\u7b97\u884c\u6570\uff0c\u7136\u540e\u8ba1\u7b97\u5217\u6570\u3002\u4f8b\u5982\uff0c{{1, 2, 3}, {4, 5, 6}}\u8fd9\u4e2a\u6570\u7ec4\u6709 2 \u884c\u548c 3 \u5217\u3002 \u5982\u4f55\u8ba1\u7b97 Java \u4e2d\u4e8c\u7ef4\u6570\u7ec4\u7684\u957f\u5ea6 \u8981\u8ba1\u7b97 Java \u4e2d\u4e8c\u7ef4\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u8ba1\u7b97\u884c\u6570 int rowCount = array.length; \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b 2. \u8ba1\u7b97\u5217\u6570 int colCount = array[0].length; \u793a\u4f8b int[][] array = { {1, 2, 3}, {4, 5, 6} }; int rowCount = array.length; \/\/ 2 int colCount = array[0].length; \/\/ 3 [&hellip;]<\/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-66786","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/66786","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=66786"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/66786\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=66786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=66786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=66786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}