{"id":1323,"date":"2023-05-28T10:18:47","date_gmt":"2023-05-28T02:18:47","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1323"},"modified":"2023-05-28T10:18:47","modified_gmt":"2023-05-28T02:18:47","slug":"java%e5%a4%9a%e7%ba%bf%e7%a8%8b%e4%b8%93%e9%a2%98%e4%b9%8b%e7%ba%bf%e7%a8%8b%e6%b1%a0%e7%9a%84%e5%9f%ba%e6%9c%ac%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/java\/java%e5%a4%9a%e7%ba%bf%e7%a8%8b%e4%b8%93%e9%a2%98%e4%b9%8b%e7%ba%bf%e7%a8%8b%e6%b1%a0%e7%9a%84%e5%9f%ba%e6%9c%ac%e4%bd%bf%e7%94%a8\/","title":{"rendered":"Java\u591a\u7ebf\u7a0b\u4e13\u9898\u4e4b\u7ebf\u7a0b\u6c60\u7684\u57fa\u672c\u4f7f\u7528"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"font-size: 16px; color: black; padding: 0 10px; word-spacing: 0px; word-break: break-word; word-wrap: break-word; text-align: left; line-height: 1.25; letter-spacing: 2px; background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%); background-size: 20px 20px; background-position: center center; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;\" data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\">\n<h1 style=\"margin-top: 30px; margin-bottom: 15px; padding: 0px; font-weight: bold; color: black; font-size: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"display: inline-block; font-weight: bold; color: #773098;\">Java\u591a\u7ebf\u7a0b\u4e13\u9898\u4e4b\u7ebf\u7a0b\u6c60\u7684\u57fa\u672c\u4f7f\u7528<\/span><\/h1>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; padding: 0px; font-weight: bold; color: black; font-size: 22px; text-align: left; margin: 20px 10px 0px 0px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; font-weight: bold; display: inline-block; padding-left: 10px; border-left: 5px solid #916dd5;\">\u524d\u8a00<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black; margin: 10px 0px; letter-spacing: 2px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u76ee\u524d\u6b63\u5728\u51fa\u4e00\u4e2a<code style=\"font-size: 14px; word-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0 2px; background-color: rgba(27,31,35,.05); font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #916dd5; font-weight: bolder; background: none;\">Java\u591a\u7ebf\u7a0b\u4e13\u9898<\/code>\u957f\u671f\u7cfb\u5217\u6559\u7a0b\uff0c\u4ece\u5165\u95e8\u5230\u8fdb\u9636\u542b<code style=\"font-size: 14px; word-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0 2px; background-color: rgba(27,31,35,.05); font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #916dd5; font-weight: bolder; background: none;\">\u6e90\u7801\u89e3\u8bfb<\/code>, \u7bc7\u5e45\u4f1a\u8f83\u591a, \u559c\u6b22\u7684\u8bdd\uff0c\u7ed9\u4e2a\u5173\u6ce8\u2764\ufe0f ~<\/p>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black; margin: 10px 0px; letter-spacing: 2px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u672c\u8282\u4e3b\u8981\u5e26\u5927\u5bb6\u8ba4\u8bc6\u4e00\u4e0b\u7ebf\u7a0b\u6c60\u4ee5\u53ca\u5b83\u7684\u57fa\u672c\u4f7f\u7528,\u4e00\u8d77\u6765\u770b\u4e0b\u5427~<\/p>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; padding: 0px; font-weight: bold; color: black; font-size: 22px; text-align: left; margin: 20px 10px 0px 0px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; font-weight: bold; display: inline-block; padding-left: 10px; border-left: 5px solid #916dd5;\">\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528\u7ebf\u7a0b\u6c60<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black; margin: 10px 0px; letter-spacing: 2px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528\u7ebf\u7a0b\u6c60\u4e3b\u8981\u6709\u4ee5\u4e0b\u4e09\u4e2a\u539f\u56e0\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: decimal; font-size: 15px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101; font-size: 14px; font-weight: normal;\">\u521b\u5efa\/\u9500\u6bc1\u7ebf\u7a0b\u9700\u8981\u6d88\u8017\u7cfb\u7edf\u8d44\u6e90\uff0c\u7ebf\u7a0b\u6c60\u53ef\u4ee5<strong style=\"color: #916dd5; font-weight: bold;\">\u300c\u590d\u7528\u5df2\u521b\u5efa\u7684\u7ebf\u7a0b\u300d<\/strong>\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101; font-size: 14px; font-weight: normal;\"><strong style=\"color: #916dd5; font-weight: bold;\">\u300c\u63a7\u5236\u5e76\u53d1\u7684\u6570\u91cf\u300d<\/strong>,\u5e76\u53d1\u6570\u91cf\u8fc7\u591a\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u8d44\u6e90\u6d88\u8017\u8fc7\u591a\uff0c\u4ece\u800c\u9020\u6210\u670d\u52a1\u5668\u5d29\u6e83\u3002<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: #010101; font-size: 14px; font-weight: normal;\"><strong style=\"color: #916dd5; font-weight: bold;\">\u300c\u53ef\u4ee5\u5bf9\u7ebf\u7a0b\u505a\u7edf\u4e00\u7ba1\u7406\u300d<\/strong>\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; padding: 0px; font-weight: bold; color: black; font-size: 22px; text-align: left; margin: 20px 10px 0px 0px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; font-weight: bold; display: inline-block; padding-left: 10px; border-left: 5px solid #916dd5;\">\u4f7f\u7528\u7ebf\u7a0b\u6c60\u7684\u57fa\u672c\u65b9\u5f0f<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black; margin: 10px 0px; letter-spacing: 2px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e0b\u9762\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u5e38\u7528\u7684\u51e0\u79cd\u65b9\u5f0f\uff0c\u5e9f\u8bdd\u4e0d\u591a\u8bf4\u76f4\u63a5\u770b\u4ee3\u7801<\/p>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; padding: 0px; color: black; font-size: 16px; font-weight: bold; text-align: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"border-bottom: 2px solid #d89cf6;\">newCachedThreadPool<\/span><\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black; margin: 10px 0px; letter-spacing: 2px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u521b\u5efa\u4e00\u4e2a\u7ebf\u7a0b\u6c60\uff0c\u6839\u636e\u9700\u8981\u521b\u5efa\u65b0\u7ebf\u7a0b\uff0c\u4f46\u5728\u53ef\u7528\u65f6\u5c06\u91cd\u7528\u4ee5\u524d\u6784\u9020\u7684\u7ebf\u7a0b\u3002\u8fd9\u4e9b\u6c60\u901a\u5e38\u4f1a\u63d0\u9ad8\u6267\u884c\u8bb8\u591a\u77ed\u671f\u5f02\u6b65\u4efb\u52a1\u7684\u7a0b\u5e8f\u7684\u6027\u80fd\u3002\u5982\u679c\u53ef\u7528\uff0c\u5bf9execute\u7684\u8c03\u7528\u5c06\u91cd\u7528\u4ee5\u524d\u6784\u9020\u7684\u7ebf\u7a0b\u3002\u5982\u679c\u6ca1\u6709\u53ef\u7528\u7684\u73b0\u6709\u7ebf\u7a0b\uff0c\u5c06\u521b\u5efa\u4e00\u4e2a\u65b0\u7ebf\u7a0b\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u6c60\u4e2d\u3002\u516d\u5341\u79d2\u5185\u672a\u4f7f\u7528\u7684\u7ebf\u7a0b\u5c06\u88ab\u7ec8\u6b62\u5e76\u4ece\u7f13\u5b58\u4e2d\u5220\u9664\u3002\u56e0\u6b64\uff0c\u4fdd\u6301\u7a7a\u95f2\u8db3\u591f\u957f\u65f6\u95f4\u7684\u6c60\u4e0d\u4f1a\u6d88\u8017\u4efb\u4f55\u8d44\u6e90\u3002<\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #282c34; border-radius: 5px;\"><span style=\"color: #c678dd; line-height: 26px;\">public<\/span>\u00a0<span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">class<\/span>\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">SingleThreadPool<\/span>\u00a0<\/span>{\n\u00a0\u00a0\u00a0\u00a0<span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">public<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">static<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">void<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">(String[]\u00a0args)<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">throws<\/span>\u00a0Exception\u00a0<\/span>{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ExecutorService\u00a0executor\u00a0=\u00a0Executors.newSingleThreadExecutor();\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0IntStream.range(<span style=\"color: #d19a66; line-height: 26px;\">0<\/span>,\u00a0<span style=\"color: #d19a66; line-height: 26px;\">50<\/span>).forEach(i\u00a0-&gt;\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0executor.execute(()\u00a0-&gt;\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0System.out.println(i);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});\n\n\u00a0\u00a0\u00a0\u00a0}\n}\n<\/code><\/pre>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; padding: 0px; font-weight: bold; color: black; font-size: 22px; text-align: left; margin: 20px 10px 0px 0px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; font-weight: bold; display: inline-block; padding-left: 10px; border-left: 5px solid #916dd5;\">\u7ed3\u675f\u8bed<\/span><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; color: black; margin: 10px 0px; letter-spacing: 2px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u672c\u8282\u4e3b\u8981\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e86<code style=\"font-size: 14px; word-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0 2px; background-color: rgba(27,31,35,.05); font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #916dd5; font-weight: bolder; background: none;\">\u7ebf\u7a0b\u6c60<\/code>\u7684\u56db\u79cd\u57fa\u672c\u4f7f\u7528\u65b9\u5f0f,\u4e0b\u4e00\u8282\uff0c\u96be\u5ea6\u52a0\u6df1, \u4ece\u6e90\u7801\u89d2\u5ea6\u6765\u5e26\u5927\u5bb6\u4e86\u89e3\u4e00\u4e0b<code style=\"font-size: 14px; word-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0 2px; background-color: rgba(27,31,35,.05); font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: #916dd5; font-weight: bolder; background: none;\">\u7ebf\u7a0b\u6c60<\/code>\u7684\u5de5\u4f5c\u539f\u7406 ~<\/p>\n<\/section>\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: \u7a0b\u5e8f\u5458\u76ae\u5361\u79cb<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>Java\u591a\u7ebf\u7a0b\u4e13\u9898\u4e4b\u7ebf\u7a0b\u6c60\u7684\u57fa\u672c\u4f7f\u7528 \u524d\u8a00 \u76ee\u524d\u6b63\u5728\u51fa\u4e00\u4e2aJava\u591a\u7ebf\u7a0b\u4e13\u9898\u957f\u671f\u7cfb\u5217\u6559\u7a0b\uff0c\u4ece\u5165\u95e8\u5230\u8fdb\u9636\u542b\u6e90\u7801\u89e3\u8bfb, \u7bc7\u5e45\u4f1a\u8f83\u591a,  &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1320,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-1323","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042046432-150x150.jpeg","content_first_image":null,"post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042046432-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042046432.jpeg","post_frist_image":null,"post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042046432-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042046432.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042046432.jpeg","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Java","post_date":"2023-05-28","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":341,"next_post_id":1327,"next_post_title":"\u9762\u8bd5\u5b98: \u6709\u4e86\u89e3\u8fc7\u7ebf\u7a0b\u6c60\u7684\u5de5\u4f5c\u539f\u7406\u5417\uff1f\u8bf4\u8bf4\u770b","previous_post_id":1339,"previous_post_title":"\u9762\u8bd5\u5b98: \u963b\u585e\u961f\u5217\u7684\u5e95\u5c42\u5b9e\u73b0\u6709\u4e86\u89e3\u8fc7\u5417? \u8bf4\u8bf4\u770b","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1323"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1323\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1320"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}