{"id":64793,"date":"2025-05-03T15:56:04","date_gmt":"2025-05-03T07:56:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/64793\/"},"modified":"2025-05-03T15:56:04","modified_gmt":"2025-05-03T07:56:04","slug":"%e5%a6%82%e4%bd%95%e5%b0%86-java-%e6%95%b0%e7%bb%84%e6%8c%89%e7%85%a7%e6%8c%87%e5%ae%9a%e5%85%83%e7%b4%a0%e6%8b%86%e5%88%86%e6%88%90%e5%a4%9a%e4%b8%aa%e5%ad%90%e6%95%b0%e7%bb%84%ef%bc%9f-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/64793\/","title":{"rendered":"\u5982\u4f55\u5c06 Java \u6570\u7ec4\u6309\u7167\u6307\u5b9a\u5143\u7d20\u62c6\u5206\u6210\u591a\u4e2a\u5b50\u6570\u7ec4\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173077022548993.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5c06 Java \u6570\u7ec4\u6309\u7167\u6307\u5b9a\u5143\u7d20\u62c6\u5206\u6210\u591a\u4e2a\u5b50\u6570\u7ec4\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5c06 Java \u6570\u7ec4\u6309\u7167\u6307\u5b9a\u5143\u7d20\u62c6\u5206\u6210\u591a\u4e2a\u5b50\u6570\u7ec4\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>java \u6570\u7ec4\u62c6\u5206<\/strong><\/p>\n<p>\u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u5c06\u4e00\u4e2a java \u6570\u7ec4\u62c6\u5206\u6210\u591a\u4e2a\u65b0\u6570\u7ec4\uff0c\u6bcf\u4e2a\u5b50\u6570\u7ec4\u4ee5\u6307\u5b9a\u7684\u5143\u7d20\u4e3a\u5f00\u59cb\u3002<\/p>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u7ed9\u5b9a\u6570\u7ec4[85, -86, 13, 2, 99, 99, 99, 99, 98, 98, 99, 99, 99, 99, 20, 85, -86, 13, 2, 99, 99, 99, 99, 99, 99, 99, 85, 12, 85, -86, 13, 2, 99]\uff0c\u6309\u7167\u5143\u7d20 85 \u62c6\u5206\u6210\u591a\u4e2a\u65b0\u6570\u7ec4\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>**\u8f93\u51fa\uff1a**\n\n[85, -86, 13, 2, 99, 99, 99, 99, 98, 98, 99, 99, 99, 99, 20]\n[85, -86, 13, 2, 99, 99, 99, 99, 99, 99, 99]\n[85, 12]\n[85, -86, 13, 2, 99]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<pre>public void ArrFun1() {\n    int[] arr = {85, -86, 13, 2, 99, 99, 99, 99, 98, 98, 99, 99, 99, 99, 20, 85, -86, 13, 2, 99, 99, 99, 99, 99, 99, 99, 85, 12, 85, -86, 13, 2, 99};\n    List&lt;List&lt;Integer&gt;&gt; list = new ArrayList&lt;&gt;();\n    List&lt;Integer&gt; temp = new ArrayList&lt;&gt;();\n    for (int i = 0; i &lt; arr.length; i++) {\n        if (arr[i] == 85) {\n            if (temp.size() &gt; 0) {\n                list.add(new ArrayList&lt;&gt;(temp));\n                temp.clear();\n            }\n            temp.add(arr[i]);\n        } else {\n            temp.add(arr[i]);\n        }\n    }\n    list.add(temp);\n    System.out.println(\"================\");\n    for (List item : list) {\n        System.out.println(Arrays.toString(item.toArray()));\n    }\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u7ed9\u5b9a\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u5c06\u6570\u7ec4 arr \u62c6\u5206\u4e3a\u5305\u542b\u5143\u7d20 85 \u7684\u591a\u4e2a\u5b50\u5217\u8868\u3002\u8fd9\u4e9b\u5b50\u5217\u8868\u968f\u540e\u8f6c\u6362\u4e3a\u6570\u7ec4\u5e76\u6253\u5370\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5c06 Java \u6570\u7ec4\u6309\u7167\u6307\u5b9a\u5143\u7d20\u62c6\u5206\u6210\u591a\u4e2a\u5b50\u6570\u7ec4\uff1f\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>java \u6570\u7ec4\u62c6\u5206 \u672c\u6587\u63a2\u8ba8\u4e86\u5982\u4f55\u5c06\u4e00\u4e2a java \u6570\u7ec4\u62c6\u5206\u6210\u591a\u4e2a\u65b0\u6570\u7ec4\uff0c\u6bcf\u4e2a\u5b50\u6570\u7ec4\u4ee5\u6307\u5b9a\u7684\u5143\u7d20\u4e3a\u5f00\u59cb\u3002 \u793a\u4f8b\uff1a \u7ed9\u5b9a\u6570\u7ec4[85, -86, 13, 2, 99, 99, 99, 99, 98, 98, 99, 99, 99, 99, 20, 85, -86, 13, 2, 99, 99, 99, 99, 99, 99, 99, 85, 12, 85, -86, 13, 2, 99]\uff0c\u6309\u7167\u5143\u7d20 85 \u62c6\u5206\u6210\u591a\u4e2a\u65b0\u6570\u7ec4\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b **\u8f93\u51fa\uff1a** [85, -86, 13, 2, 99, 99, 99, 99, 98, 98, 99, 99, [&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-64793","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64793","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=64793"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64793\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=64793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=64793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=64793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}