{"id":11023,"date":"2025-04-18T18:23:39","date_gmt":"2025-04-18T10:23:39","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/11023.html"},"modified":"2025-04-18T18:23:39","modified_gmt":"2025-04-18T10:23:39","slug":"%e3%80%90javaee%e5%88%9d%e9%98%b6%e3%80%91%e6%b7%b1%e5%85%a5%e7%90%86%e8%a7%a3%e5%a4%9a%e7%ba%bf%e7%a8%8b%e9%98%bb%e5%a1%9e%e9%98%9f%e5%88%97%e7%9a%84%e5%8e%9f%e7%90%86%ef%bc%8c%e5%a6%82%e4%bd%95","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/11023.html","title":{"rendered":"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"720\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-6802282840e21.gif\" width=\"1200\" \/><\/p>\n<p><span style=\"color:#956fe7\">\u524d\u8a00&#xff1a;<\/span><\/p>\n<p><span style=\"color:#38d8f0\">&#x1f308;\u4e0a\u671f\u535a\u5ba2&#xff1a;\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u89e3\u6790\u5355\u4f8b\u6a21\u5f0f\u4e2d\u7684\u997f\u6c49\u6a21\u5f0f&#xff0c;\u61d2\u6c49\u6a21\u5f0f\u7684\u5b9e\u73b0\u4ee5\u53ca\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span style=\"color:#38d8f0\">&#x1f525;\u611f\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u770b\u4e00\u770b\u5c0f\u7f16\u4e3b\u9875&#xff1a;GGBondlctrl-CSDN\u535a\u5ba2<\/span><\/p>\n<p><span style=\"color:#38d8f0\">\u2b50\ufe0f\u5c0f\u7f16\u4f1a\u5728\u540e\u7aef\u5f00\u53d1\u7684\u5b66\u4e60\u4e2d\u4e0d\u65ad\u66f4\u65b0~~~ \u00a0<\/span><\/p>\n<p><span style=\"color:#38d8f0\">&#x1f973;\u975e\u5e38\u611f\u8c22\u4f60\u7684\u652f\u6301<\/span><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-680228288a957.gif\" \/><\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%F0%9F%93%9A%EF%B8%8F1.%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97-toc\" style=\"margin-left:40px\">&#x1f4da;\ufe0f1.\u963b\u585e\u961f\u5217<\/p>\n<p id=\"%C2%A01.1%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97%E7%9A%84%E7%89%B9%E6%80%A7-toc\" style=\"margin-left:80px\">\u00a01.1\u963b\u585e\u961f\u5217\u7684\u7279\u6027<\/p>\n<p id=\"1.2%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97%E7%9A%84%E4%BD%BF%E7%94%A8-toc\" style=\"margin-left:80px\">1.2\u963b\u585e\u961f\u5217\u7684\u4f7f\u7528<\/p>\n<p id=\"1.%E5%AE%9E%E4%BE%8B%E5%8C%96-toc\" style=\"margin-left:120px\">1.\u5b9e\u4f8b\u5316<\/p>\n<p id=\"%C2%A02.%E5%85%A5%E9%98%9F%E5%88%97-toc\" style=\"margin-left:120px\">\u00a02.\u5165\u961f\u5217<\/p>\n<p id=\"3.%E5%87%BA%E9%98%9F%E5%88%97-toc\" style=\"margin-left:120px\">3.\u51fa\u961f\u5217<\/p>\n<p id=\"1.3%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97%E7%9A%84%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:80px\">1.3\u963b\u585e\u961f\u5217\u7684\u5b9e\u73b0<\/p>\n<p id=\"1.%E6%9E%84%E9%80%A0%E7%8E%AF%E5%BD%A2%E9%98%9F%E5%88%97%EF%BC%8C%E5%AE%9E%E7%8E%B0%E5%87%BA%E5%85%A5%E9%98%9F%E5%88%97%E5%8A%9F%E8%83%BD-toc\" style=\"margin-left:120px\">1.\u6784\u9020\u73af\u5f62\u961f\u5217&#xff0c;\u5b9e\u73b0\u51fa\u5165\u961f\u5217\u529f\u80fd<\/p>\n<p id=\"2.%E5%9C%A8%E5%A4%9A%E7%BA%BF%E7%A8%8B%E4%B8%AD%E8%A7%A3%E5%86%B3%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8%E9%97%AE%E9%A2%98-toc\" style=\"margin-left:120px\">2.\u5728\u591a\u7ebf\u7a0b\u4e2d\u89e3\u51b3\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898<\/p>\n<p id=\"3.%E5%A4%9A%E7%BA%BF%E7%A8%8B%E5%AE%9E%E7%8E%B0%E9%98%BB%E5%A1%9E%E5%94%A4%E9%86%92%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:120px\">3.\u591a\u7ebf\u7a0b\u5b9e\u73b0\u963b\u585e\u5524\u9192\u64cd\u4f5c<\/p>\n<p id=\"%C2%A0%F0%9F%93%9A%EF%B8%8F2.%E7%94%9F%E4%BA%A7%E8%80%85-%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B-toc\" style=\"margin-left:40px\">\u00a0&#x1f4da;\ufe0f2.\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b<\/p>\n<p id=\"2.1%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E7%9A%84%E6%A8%A1%E6%8B%9F%C2%A0-toc\" style=\"margin-left:80px\">2.1\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u7684\u6a21\u62df\u00a0<\/p>\n<p id=\"2.2%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E7%9A%84%E4%BD%9C%E7%94%A8-toc\" style=\"margin-left:80px\">2.2\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u7684\u4f5c\u7528<\/p>\n<p id=\"1.%E8%A7%A3%E8%80%A6%E5%90%88-toc\" style=\"margin-left:120px\">1.\u89e3\u8026\u5408<\/p>\n<p id=\"2.%E5%89%8A%E5%B3%B0%E5%A1%AB%E8%B0%B7-toc\" style=\"margin-left:120px\">2.\u524a\u5cf0\u586b\u8c37<\/p>\n<p id=\"2.3%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E4%BB%A3%E4%BB%B7-toc\" style=\"margin-left:80px\">2.3\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u4ee3\u4ef7<\/p>\n<p id=\"2.4%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E6%A8%A1%E6%8B%9F-toc\" style=\"margin-left:80px\">2.4\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u6a21\u62df<\/p>\n<p id=\"%F0%9F%93%9A%EF%B8%8F3%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:40px\">&#x1f4da;\ufe0f3\u603b\u7ed3<\/p>\n<hr id=\"hr-toc\" \/>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-6802282896d4b.gif\" \/><\/p>\n<h3 id=\"%F0%9F%93%9A%EF%B8%8F1.%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97\">&#x1f4da;\ufe0f1.\u963b\u585e\u961f\u5217<\/h3>\n<h4 id=\"%C2%A01.1%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97%E7%9A%84%E7%89%B9%E6%80%A7\">\u00a01.1\u963b\u585e\u961f\u5217\u7684\u7279\u6027<\/h4>\n<p>\u6240\u8c13\u7684\u963b\u585e\u961f\u5217\u5373\u5bf9\u4e8e\u666e\u901a\u961f\u5217\u505a\u51fa\u7684\u6269\u5c55&#xff0c;\u8fd9\u4e2a\u961f\u5217\u5177\u6709\u666e\u901a\u961f\u5217\u7684\u7279\u6027&#xff0c;<span style=\"background-color:#ffd900\">\u5148\u8fdb\u5148\u51fa&#xff0c;\u5e76\u4e14\u963b\u585e\u961f\u5217\u662f\u7ebf\u7a0b\u5b89\u5168\u7684&#xff0c;\u5177\u6709\u963b\u585e\u7684\u529f\u80fd~~~<\/span><\/p>\n<p>\u963b\u585e\u529f\u80fd&#xff1a;<\/p>\n<p>\u5982\u679c\u9488\u5bf9\u4e00\u4e2a\u5df2\u7ecf\u6ee1\u4e86\u7684\u963b\u585e\u961f\u5217&#xff0c;\u5728\u5f80\u961f\u5217\u91cc\u52a0\u5165\u6570\u636e&#xff0c;\u6b64\u65f6\u961f\u5217\u5c31\u4f1a\u53d1\u751f\u963b\u585e&#xff0c;\u76f4\u5230\u963b\u585e\u5230\u961f\u5217\u4e0d\u4e3a\u6ee1\u4e3a\u6b62~~~<\/p>\n<p>\u5982\u679c\u9488\u5bf9\u4e00\u4e2a\u5df2\u7ecf\u7a7a\u4e86\u7684\u963b\u585e\u961f\u5217&#xff0c;\u5728\u5f80\u961f\u5217\u91cc\u53d6\u51fa\u6570\u636e&#xff0c;\u6b64\u65f6\u961f\u5217\u5c31\u4f1a\u53d1\u751f\u963b\u585e&#xff0c;\u76f4\u5230\u963b\u585e\u5230\u961f\u5217\u4e0d\u4e3a\u7a7a\u4e3a\u6b62~~~<\/p>\n<h4 id=\"1.2%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97%E7%9A%84%E4%BD%BF%E7%94%A8\">1.2\u963b\u585e\u961f\u5217\u7684\u4f7f\u7528<\/h4>\n<h5 id=\"1.%E5%AE%9E%E4%BE%8B%E5%8C%96\">1.\u5b9e\u4f8b\u5316<\/h5>\n<p>\u5728Java\u6807\u51c6\u5e93\u4e2d\u6709\u963b\u585e\u961f\u5217\u7684\u6570\u636e\u7ed3\u6784&#xff0c;\u5982\u4e0b\u4ee3\u7801\u6240\u793a&#xff1a;<\/p>\n<p> BlockingQueue&lt;Integer&gt; queue&#061;new ArrayBlockingQueue&lt;&gt;(4); <\/p>\n<p>\u00a0\u8fd9\u91cc\u7684ArrayBlockingQueue&lt;&gt;\u5373\u7528\u6570\u7ec4\u5b9e\u73b0\u7684\u963b\u585e\u961f\u5217&#xff0c;<span style=\"background-color:#ffd900\">\u91cc\u9762\u76844\u5c31\u662f\u5b58\u50a8\u91cf<\/span><\/p>\n<p>\u8fd9\u91cc\u8fd8\u5b58\u5728\u7528\u94fe\u8868\u5b9e\u73b0&#xff0c;\u548c\u4f18\u5148\u7ea7\u961f\u5217\u5b9e\u73b0\u7684\u4f18\u5148\u7ea7\u961f\u5217&#xff0c;\u5982\u4e0b\u4ee3\u7801\u6240\u793a&#xff1a;<\/p>\n<p> BlockingQueue&lt;Integer&gt; queue&#061;new ArrayBlockingQueue&lt;&gt;(4);<br \/>\n BlockingQueue&lt;Integer&gt; queue1&#061;new LinkedBlockingQueue&lt;&gt;(4);<br \/>\n BlockingQueue&lt;Integer&gt; queue2&#061;new PriorityBlockingQueue&lt;&gt;(4); <\/p>\n<h5 id=\"%C2%A02.%E5%85%A5%E9%98%9F%E5%88%97\">\u00a02.\u5165\u961f\u5217<\/h5>\n<p>\u8fd9\u91cc\u4f7f\u7528put\u6216\u8005offer\u6765\u8fdb\u884c\u5165\u961f\u5217&#xff0c;<span style=\"background-color:#ffd900\">\u4f46\u662f\u8fd9\u91cc\u7684put\u5177\u6709\u963b\u585e\u7684\u529f\u80fd&#xff0c;\u800coffer\u6ca1\u6709<\/span>&#xff0c;\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>queue.put(1);<br \/>\nqueue.put(2);<br \/>\nqueue.put(3);<br \/>\nqueue.put(4); <\/p>\n<p>\u8fd9\u91cc\u518d\u6dfb\u52a0\u6570\u636e&#xff0c;\u6211\u4eec\u770bdebug\u4e00\u4e0b&#xff0c;\u6d4b\u8bd5&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"427\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-68022828a2ae2.png\" width=\"445\" \/><\/p>\n<p>\u6b64\u65f6\u6211\u4eec\u80fd\u591f\u770b\u5230\u4f7f\u7528put\u5728\u8fbe\u5230\u5b58\u50a8\u6700\u5927\u503c\u65f6&#xff0c;\u5c31\u4e0d\u518d\u6dfb\u52a0\u6570\u636e\u4e86&#xff1b;<\/p>\n<p>\u4f7f\u7528offer\u6dfb\u52a0\u6570\u636e\u65f6&#xff0c;\u6211\u4eec\u518d\u6b21Debug\u4e00\u4e0b\u540e&#xff1a;<\/p>\n<p>queue.offer(1);<br \/>\nqueue.offer(2);<br \/>\nqueue.offer(3);<br \/>\nqueue.offer(4);<br \/>\nSystem.out.println(queue.offer(5)); <\/p>\n<p>\u6b64\u65f6\u6211\u4eec\u6253\u5370\u4e00\u4e2afalse&#xff0c;\u4e14\u7ed3\u675f\u8fdb\u7a0b&#xff0c;<span style=\"background-color:#ffd900\">\u6240\u4ee5offer\u662f\u4e0d\u4f1a\u53d1\u751f\u963b\u585e\u7684&#xff0c;\u5f53\u961f\u5217\u6ee1\u4e86\u7684\u65f6\u5019&#xff0c;\u63d2\u5165\u6570\u636e\u6210\u529f\u4f1a\u8fd4\u56deTRUE\u53cd\u4e4b\u8fd4\u56de\u4e00\u4e2aFALSE;<\/span><\/p>\n<h5 id=\"3.%E5%87%BA%E9%98%9F%E5%88%97\">3.\u51fa\u961f\u5217<\/h5>\n<p>\u00a0\u8fd9\u91cc\u5c31\u662f\u4f7f\u7528take\u6765\u8fdb\u884c\u51fa\u961f\u5217&#xff0c;\u4e14\u8fd9\u91cc\u7684take\u4e5f\u5177\u6709\u963b\u585e\u7684\u529f\u80fd&#xff0c;\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>queue.offer(1);<br \/>\nqueue.offer(2);<br \/>\nqueue.offer(3);<br \/>\nqueue.offer(4);<br \/>\nSystem.out.println(queue.take());<br \/>\nSystem.out.println(queue.take());<\/p>\n<p><span style=\"background-color:#ffd900\">\u5f53\u963b\u585e\u961f\u5217\u4e3a\u7a7a\u7684\u65f6\u5019&#xff0c;\u51fa\u961f\u5217\u4f1a\u53d1\u751f\u963b\u585e&#xff0c;\u5373\u8fdb\u7a0b\u65e0\u6cd5\u7ed3\u675f~~~\u00a0<\/span><\/p>\n<h4 id=\"1.3%E9%98%BB%E5%A1%9E%E9%98%9F%E5%88%97%E7%9A%84%E5%AE%9E%E7%8E%B0\">1.3\u963b\u585e\u961f\u5217\u7684\u5b9e\u73b0<\/h4>\n<p>\u00a0\u8fd9\u91cc\u5c0f\u7f16\u5c06\u4f7f\u7528\u6570\u7ec4\u6765\u8fdb\u884c\u963b\u585e\u961f\u5217\u7684\u5b9e\u73b0&#xff0c;\u8fd9\u91cc\u7684\u961f\u5217\u5c31\u662f\u73af\u5f62\u961f\u5217&#xff1b;<\/p>\n<h5 id=\"1.%E6%9E%84%E9%80%A0%E7%8E%AF%E5%BD%A2%E9%98%9F%E5%88%97%EF%BC%8C%E5%AE%9E%E7%8E%B0%E5%87%BA%E5%85%A5%E9%98%9F%E5%88%97%E5%8A%9F%E8%83%BD\" style=\"background-color:transparent\">1.\u6784\u9020\u73af\u5f62\u961f\u5217&#xff0c;\u5b9e\u73b0\u51fa\u5165\u961f\u5217\u529f\u80fd<\/h5>\n<p>\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>class Myblockingqueue{<br \/>\n    \/\/\u58f0\u660e\u4e00\u4e2a\u73af\u5f62\u6570\u7ec4<br \/>\n    private int[] elems&#061;null;<br \/>\n    private int head&#061;0;<br \/>\n    private int tail&#061;0;<br \/>\n    private int size&#061;0;<br \/>\n    \/\/\u5728\u5b9e\u4f8b\u5316\u65f6&#xff0c;\u521d\u59cb\u5316\u8fd9\u4e2a\u6570\u7ec4<br \/>\n    public Myblockingqueue(int capcity){<br \/>\n        elems&#061;new int[capcity];<br \/>\n    }<br \/>\n    public void put(int elem)  {<br \/>\n            if (size&#061;&#061;elems.length){<br \/>\n                return ;<br \/>\n            }<br \/>\n            elems[tail]&#061;elem;<br \/>\n            size&#043;&#043;;<br \/>\n            tail&#043;&#043;;<br \/>\n            if (tail&gt;elems.length-1){<br \/>\n                tail&#061;0;<br \/>\n            }<br \/>\n    }<br \/>\n    public int take() {<br \/>\n            int elem&#061;0;<br \/>\n            if (size&#061;&#061;0){<\/p>\n<p>               return 0;<br \/>\n            }<br \/>\n            elem&#061;elems[head];<br \/>\n            head&#043;&#043;;<br \/>\n            size&#8211;;<br \/>\n            if (head&gt;elems.length-1){<br \/>\n                head&#061;0;<br \/>\n            }<br \/>\n            return elem;<br \/>\n    }<br \/>\n} <\/p>\n<p>\u8fd9\u91cc\u5bf9\u4e8e\u73af\u5f62\u961f\u5217\u7684\u5b9e\u73b0&#xff0c;\u5c0f\u7f16\u5c31\u4e0d\u518d\u8fc7\u591a\u8d58\u8ff0\u4e86&#xff0c;\u524d\u9762\u6570\u636e\u7ed3\u6784\u6709\u8bb2\u89e3<\/p>\n<h5 id=\"2.%E5%9C%A8%E5%A4%9A%E7%BA%BF%E7%A8%8B%E4%B8%AD%E8%A7%A3%E5%86%B3%E7%BA%BF%E7%A8%8B%E5%AE%89%E5%85%A8%E9%97%AE%E9%A2%98\" style=\"background-color:transparent\">2.\u5728\u591a\u7ebf\u7a0b\u4e2d\u89e3\u51b3\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898<\/h5>\n<p>\u5f53\u591a\u7ebf\u7a0b\u60c5\u51b5\u4e0b&#xff0c;\u5c31\u4f1a\u6709\u4ee5\u4e0b\u95ee\u9898&#xff0c;\u5982\u56fe\u6240\u793a&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-68022828bbdf4.png\" \/><\/p>\n<p>\u6ce8\u610f&#xff1a;\u8fd9\u91cc\u5f53put\u6700\u540e\u4e00\u4e2a\u6570\u636e\u7684\u65f6\u5019\u00a0\u7ebf\u7a0b1\u5224\u65ad\u5b8c\u6761\u4ef6\u540e&#xff0c;\u522b\u8c03\u5ea6\u8d70\u4e86&#xff0c;\u7136\u540e\u6b64\u65f6\u7ebf\u7a0b2\u4e5f\u6ee1\u8db3\u6761\u4ef6&#xff0c;\u6b64\u65f6tail\u4e3a100&#xff08;\u5047\u8bbe\u5b58\u8d2e\u4e3a100&#xff09;&#xff0c;\u7136\u540e\u7ebf\u7a0b1\u53c8\u8c03\u5ea6\u56deCPU\u6267\u884c\u5269\u4e0b\u7684&#xff0c;\u518d\u6b21\u6dfb\u52a0&#xff0c;\u90a3\u4e48\u5c31\u5b58\u5728101\u4e2a\u6570\u636e\u4e86&#xff0c;\u6b64\u65f6\u5c31\u53d1\u751f\u4e86\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898<\/p>\n<p>\u89e3\u51b3&#xff1a;\u6b64\u65f6\u5c31\u9700\u8981\u52a0\u9501&#xff0c;\u4f7f\u8fd9\u4e32\u4ee3\u7801\u6027\u8d28\u6539\u53d8\u4e3a\u539f\u5b50\u6027&#xff0c;\u4f7fcpu\u8c03\u5ea6\u5176\u4ed6\u7ebf\u7a0b\u53d1\u751f\u963b\u585e<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p> synchronized (lock){<br \/>\n            \/\/\u5224\u65ad\u6761\u4ef6&#xff0c;\u662f\u5426\u6ee1\u4e86&#xff0c;\u6ee1\u4e86\u5c31\u8fdb\u5165\u963b\u585e<br \/>\n            if(size&#061;&#061;elems.length){<br \/>\n                return;<br \/>\n            }<br \/>\n            elems[tail]&#061;elem;<br \/>\n            size&#043;&#043;;<br \/>\n            tail&#043;&#043;;<br \/>\n            if (tail&gt;elems.length-1){<br \/>\n                tail&#061;0;<br \/>\n            }<\/p>\n<p>        } <\/p>\n<p>\u6b64\u65f6\u7684\u51fa\u961f\u5217\u65b9\u6cd5\u4e5f\u662f\u4e00\u6837\u7684&#xff0c;\u8fdb\u884c\u52a0\u9501&#xff0c;\u89e3\u51b3\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898&#xff1b;<\/p>\n<h5 id=\"3.%E5%A4%9A%E7%BA%BF%E7%A8%8B%E5%AE%9E%E7%8E%B0%E9%98%BB%E5%A1%9E%E5%94%A4%E9%86%92%E6%93%8D%E4%BD%9C\">3.\u591a\u7ebf\u7a0b\u5b9e\u73b0\u963b\u585e\u5524\u9192\u64cd\u4f5c<\/h5>\n<p>\u00a0\u5728\u4e0a\u8ff0\u7406\u89e3\u4e2d&#xff0c;\u6211\u4eec\u5f53\u961f\u5217\u4e3a\u6ee1\u7684\u65f6\u5019&#xff0c;\u5165\u961f\u5217\u65b9\u6cd5\u5c31\u8981\u8fdb\u884c\u963b\u585e&#xff0c;\u90a3\u4e48\u5524\u9192\u65f6\u673a\u5c31\u662f\u51fa\u961f\u5217\u540e&#xff1b;\u961f\u5217\u4e3a\u7a7a\u7684\u65f6\u5019&#xff0c;\u51fa\u961f\u5217\u5c31\u8981\u8fdb\u5165\u963b\u585e&#xff0c;\u90a3\u4e48\u5524\u9192\u65f6\u673a\u5c31\u662f\u5165\u961f\u5217\u4e4b\u540e&#xff1b;<\/p>\n<p>\u5165\u961f\u5217\u65b9\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<p> synchronized (lock){<br \/>\n            \/\/\u5224\u65ad\u6761\u4ef6&#xff0c;\u662f\u5426\u6ee1\u4e86&#xff0c;\u6ee1\u4e86\u5c31\u8fdb\u5165\u963b\u585e<br \/>\n            if(size&#061;&#061;elems.length){<br \/>\n                lock.wait();<br \/>\n            }<br \/>\n            elems[tail]&#061;elem;<br \/>\n            size&#043;&#043;;<br \/>\n            tail&#043;&#043;;<br \/>\n            if (tail&gt;elems.length-1){<br \/>\n                tail&#061;0;<br \/>\n            }<br \/>\n            \/\/\u5524\u9192\u53d6\u51fa\u7ebf\u7a0b<br \/>\n            lock.notify();<br \/>\n        } <\/p>\n<p>\u00a0\u540c\u7406\u51fa\u961f\u5217\u65b9\u6cd5\u5982\u4e0b&#xff1a;<\/p>\n<p>        int elem&#061;0;<br \/>\n        \/\/\u5224\u65ad\u6761\u4ef6&#xff0c;\u5982\u679c\u4e3a\u7a7a&#xff0c;\u90a3\u4e48\u5c31\u8fdb\u5165\u963b\u585e<br \/>\n        synchronized (lock){<br \/>\n            if (size&#061;&#061;0){<br \/>\n                \/\/\u8fdb\u5165\u7ebf\u7a0b\u7b49\u5f85<br \/>\n                lock.wait();<br \/>\n            }<br \/>\n            elem&#061;elems[head];<br \/>\n            head&#043;&#043;;<br \/>\n            size&#8211;;<br \/>\n            if (head&gt;elems.length-1){<br \/>\n                head&#061;0;<br \/>\n            }<br \/>\n            lock.notify();<br \/>\n            return elem;<br \/>\n        } <\/p>\n<p>\u6b64\u65f6\u5c31\u89e3\u51b3\u4e86\u963b\u585e\u548c\u5524\u9192\u7ebf\u7a0b\u7684\u64cd\u4f5c&#xff0c;\u4f46\u662f\u6b64\u65f6\u4efb\u7136\u6709\u95ee\u9898~~~<\/p>\n<p>\u6ce8\u610f&#xff1a;\u5f53\u6709\u4e24\u5165\u961f\u5217\u7ebf\u7a0b&#xff0c;\u6b64\u65f6\u51fa\u961f\u5217\u540e\u5524\u9192\u4e00\u4e2a\u5165\u961f\u5217\u7ebf\u7a0b\u540e&#xff0c;\u601d\u8def\u662f\u6dfb\u52a0\u6570\u636e\u540e\u6ee1\u4e86\u9700\u8981\u5524\u9192\u51fa\u961f\u5217\u64cd\u4f5c&#xff0c;\u4f46\u662f\u7531\u4e8e\u9501\u5bf9\u8c61\u662f\u4e00\u6837\u7684&#xff0c;\u53ef\u80fd\u5524\u9192\u7684\u5c31\u662f\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u7684\u5165\u961f\u5217\u64cd\u4f5c~~~<\/p>\n<p>\u56fe\u793a&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-68022828e5cb6.png\" \/>\u00a0<\/p>\n<p>\u7531\u4e8eif\u53ea\u662f\u5224\u65ad\u4e00\u6b21&#xff0c;\u7531\u4e8e\u591a\u7ebf\u7a0b\u7684\u539f\u56e0&#xff0c;\u80af\u4f1a\u6709\u5f88\u591a\u53d8\u6570&#xff0c;\u6240\u4ee5\u5728\u88ab\u5524\u9192\u540e&#xff0c;\u8fd8\u9700\u8981\u5224\u65ad\u662f\u5426\u6ee1\u8db3\u961f\u5217\u6ee1\u7684\u6761\u4ef6&#xff0c;\u90a3\u4e48\u89e3\u51b3\u529e\u6cd5\u5373\u5c06if\u6539\u4e3awhile<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p>public void put(int elem) throws InterruptedException {<br \/>\n        \/\/\u9632\u6b62\u591a\u7ebf\u7a0b\u72b6\u6001\u4e0b&#xff0c;\u53d1\u751f\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898<br \/>\n        synchronized (lock){<br \/>\n            \/\/\u5224\u65ad\u6761\u4ef6&#xff0c;\u662f\u5426\u6ee1\u4e86&#xff0c;\u6ee1\u4e86\u5c31\u8fdb\u5165\u963b\u585e<br \/>\n            while (size&#061;&#061;elems.length){<br \/>\n                lock.wait();<br \/>\n            }<br \/>\n            elems[tail]&#061;elem;<br \/>\n            size&#043;&#043;;<br \/>\n            tail&#043;&#043;;<br \/>\n            if (tail&gt;elems.length-1){<br \/>\n                tail&#061;0;<br \/>\n            }<br \/>\n            \/\/\u5524\u9192\u53d6\u51fa\u7ebf\u7a0b<br \/>\n            lock.notify();<br \/>\n        }<br \/>\n    } <\/p>\n<p>\u00a0\u8fd9\u91cc\u5c31\u662f\u5165\u961f\u5217\u7684\u64cd\u4f5c&#xff0c;\u90a3\u4e48\u540c\u7406\u51fa\u961f\u5217\u4e5f\u662f\u4e00\u6837\u7684&#xff0c;\u9700\u8981\u5c31\u90a3\u4e9bwhile\u7684\u5faa\u73af\u5224\u65ad~~~&#xff0c;\u90a3\u4e48\u6b64\u65f6\u6211\u4eec\u7684\u963b\u585e\u961f\u5217\u7684\u5b9e\u73b0\u5c31\u5b8c\u6210\u4e86&#xff1b;<\/p>\n<h3 id=\"%C2%A0%F0%9F%93%9A%EF%B8%8F2.%E7%94%9F%E4%BA%A7%E8%80%85-%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B\" style=\"background-color:transparent\">\u00a0&#x1f4da;\ufe0f2.\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b<\/h3>\n<p>\u6ce8\u610f&#xff1a;<span style=\"background-color:#ffd900\">\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u662f\u6839\u636e\u963b\u585e\u961f\u5217\u6765\u8fdb\u884c\u5b9e\u73b0\u7684<\/span>\u00a0<\/p>\n<h4 id=\"2.1%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E7%9A%84%E6%A8%A1%E6%8B%9F%C2%A0\">2.1\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u7684\u6a21\u62df\u00a0<\/h4>\n<p>\u8fd9\u91cc\u5c0f\u7f16\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u5305\u997a\u5b50\u7684\u8fc7\u7a0b\u6765\u4e3a\u5927\u5bb6\u5c55\u793a\u8fd9\u4e2a\u6a21\u578b\u7684\u73b0\u5b9e\u573a\u666f<\/p>\n<p>\u5728\u5305\u997a\u5b50\u4e2d&#xff0c;\u6211\u4eec\u4e00\u822c\u662f\u4e00\u4e2a\u4eba\u64c0\u9762&#xff0c;\u7136\u540e\u53e6\u5916\u4e24\u4e2a&#xff08;\u5047\u8bbe&#xff09;\u4eba\u8fdb\u884c\u5305\u997a\u5b50&#xff0c;\u56fe\u793a\u5982\u4e0b&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102337-68022829462d8.png\" \/><\/p>\n<p>\u6b64\u65f6\u8fd9\u91cc\u4e24\u4e2a\u5305\u997a\u5b50\u7684\u4eba\u5c31\u662f\u6d88\u8d39\u8005\u7ebf\u7a0b&#xff0c;\u800c\u64c0\u9762\u7684\u4eba\u5c31\u662f\u4e00\u4e2a\u751f\u4ea7\u8005\u7ebf\u7a0b&#xff1b;<\/p>\n<p>\u6b64\u65f6\u7684\u684c\u5b50\u5373\u662f\u4e00\u4e2a\u963b\u585e\u961f\u5217&#xff0c;\u8d1f\u8d23\u63a5\u6536\u9762\u76ae&#xff0c;\u5e76\u4f20\u9012\u9762\u76ae\u7ed9\u5305\u997a\u5b50\u7684\u4eba&#xff1b;<\/p>\n<p>\u6ce8\u610f&#xff1a;<\/p>\n<p>\u5047\u8bbe\u64c0\u9762\u7684\u4eba&#xff0c;\u64c0\u997a\u5b50\u76ae\u5f88\u5feb&#xff0c;\u90a3\u4e48\u6b64\u65f6\u5c31\u662f\u751f\u4ea7\u5927\u4e8e\u6d88\u8d39&#xff0c;\u90a3\u4e48\u5f88\u5feb\u684c\u5b50\u5c31\u4f1a\u88ab\u997a\u5b50\u586b\u6ee1&#xff0c;\u6b64\u65f6\u64c0\u9762\u7684\u4eba\u5c31\u4e0d\u80fd\u64c0\u9762\u4e86&#xff08;\u7c7b\u4f3c\u4e8e\u963b\u585e&#xff09;&#xff0c;\u7136\u540e\u4e24\u4e2a\u5305\u997a\u5b50\u7684\u4eba\u5305\u4e00\u4e2a&#xff0c;\u64c0\u9762\u7684\u5c31\u751f\u4ea7\u4e00\u4e2a\u00a0\u9762\u76ae&#xff1b;<\/p>\n<p>\u5047\u8bbe\u5305\u997a\u5b50\u7684\u4eba&#xff0c;\u5305\u5f97\u5f88\u5feb&#xff0c;\u90a3\u4e48\u6b64\u65f6\u7684\u6d88\u8d39\u5c31\u5927\u4e8e\u751f\u4ea7&#xff0c;\u90a3\u4e48\u5f88\u5feb\u684c\u5b50\u5c31\u4e3a\u7a7a\u4e86&#xff0c;\u90a3\u4e48\u5305\u997a\u5b50\u7684\u4eba\u5c31\u5f97\u7b49\u64c0\u9762\u7684\u4eba&#xff08;\u7c7b\u4f3c\u4e8e\u963b\u585e&#xff09;&#xff0c;\u7136\u540e\u5c31\u662f\u64c0\u9762\u7684\u4eba\u64c0\u51fa\u6765\u4e00\u5f20\u9762\u76ae&#xff0c;\u5305\u997a\u5b50\u7684\u4eba\u5c31\u6d88\u8d39\u4e00\u5f20&#xff1b;<\/p>\n<h4 id=\"2.2%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E7%9A%84%E4%BD%9C%E7%94%A8\">2.2\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u7684\u4f5c\u7528<\/h4>\n<h5 id=\"1.%E8%A7%A3%E8%80%A6%E5%90%88\">1.\u89e3\u8026\u5408<\/h5>\n<p>\u89e3\u8026\u5408&#xff1a;\u5c06\u4ee3\u7801\u7684\u8026\u5408\u7a0b\u5ea6\u53c8\u9ad8\u964d\u4f4e\u53eb\u505a\u89e3\u8026\u5408~~~<\/p>\n<p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d&#xff0c;\u901a\u5e38\u662f\u201c\u5206\u5e03\u5f0f\u7cfb\u7edf\u201d&#xff0c;\u5373\u6574\u4e2a\u529f\u80fd\u4e0d\u662f\u7531\u4e00\u53f0\u670d\u52a1\u5668\u6765\u5b8c\u6210\u7684&#xff0c;\u800c\u662f\u6bcf\u4e2a\u670d\u52a1\u5668\u8d1f\u8d23\u4e00\u90e8\u5206\u529f\u80fd&#xff0c;\u7136\u540e\u901a\u8fc7\u7f51\u7edc\u901a\u4fe1\u6765\u8fdb\u884c\u8fde\u63a5&#xff0c;\u5171\u540c\u5b8c\u6210\u7684&#xff1b;<\/p>\n<p>\u90a3\u4e48\u5f53\u6211\u4eec\u4e0d\u4f7f\u7528\u963b\u585e\u961f\u5217\u65f6&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102337-6802282967a20.png\" \/><\/p>\n<p>\u95ee\u9898&#xff1a;\u6b64\u65f6\u7531\u4e8e\u6ca1\u963b\u585e\u961f\u5217&#xff0c;A\u548cB\u7684\u8026\u5408\u6027\u5c31\u5f88\u5f3a&#xff0c;A\u548cC\u7684\u8026\u5408\u6027\u5c31\u5f88\u5f3a&#xff0c;A\u4e2d\u7684\u4ee3\u7801\u8bbe\u8ba1\u5230B\u7684\u4e00\u4e9b\u76f8\u5173\u64cd\u4f5c&#xff0c;B\u4e5f\u8bbe\u8ba1\u5230A\u7684\u4e00\u4e9b\u76f8\u5173\u64cd\u4f5c&#xff0c;\u6b64\u65f6\u5982\u8981\u66f4\u6539B&#xff0c;\u90a3\u4e48A\u4e5f\u4f1a\u53d7\u5230\u5f71\u54cd&#xff0c;\u540c\u7406A\u548cC\u4e5f\u662f\u4e00\u6837\u7684&#xff1b;<\/p>\n<p>\u00a0\u90a3\u4e48\u52a0\u5165\u963b\u585e\u961f\u5217&#xff1a;<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102337-680228298b11b.png\" \/><\/p>\n<p>\u6ce8\u610f&#xff1a;\u6b64\u65f6\u963b\u585e\u961f\u5217\u5c31\u662f\u4e00\u4e2a\u4e2d\u4ecb&#xff0c;\u670d\u52a1\u5668A\u4e0d\u77e5\u9053\u670d\u52a1\u5668B\u548cC,\u6b64\u65f6A\u53ea\u9700\u8981\u4f20\u9012\u6570\u636e\u7ed9\u963b\u585e\u961f\u5217&#xff0c;\u518d\u7531\u963b\u585e\u961f\u5217\u4f20\u9012\u7ed9B\u548cC&#xff0c;\u6b64\u65f6\u76f8\u5e94\u7684\u8026\u5408\u6027\u5c31\u6253\u6253\u964d\u4f4e\u4e86&#xff1b;\u4e4b\u95f4\u7684\u5f71\u54cd\u4e5f\u4e0b\u964d\u4e86&#xff1b;<\/p>\n<h5 id=\"2.%E5%89%8A%E5%B3%B0%E5%A1%AB%E8%B0%B7\">2.\u524a\u5cf0\u586b\u8c37<\/h5>\n<p>\u7531\u4e8e\u8bf7\u6c42\u662f\u5ba2\u6237\u7aef\u4e00\u65b9\u7684\u9700\u6c42&#xff0c;\u6240\u4ee5\u5b58\u5728\u4e00\u65f6\u95f4\u7a81\u7136\u8bf7\u6c42\u9aa4\u589e&#xff0c;\u90a3\u4e48\u6b64\u65f6\u5c31\u5b58\u5728\u670d\u52a1\u5668\u5d29\u6389\u7684\u95ee\u9898<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102337-6802282967a20.png\" \/><\/p>\n<p>\u5c31\u8fd9\u4e2a\u56fe\u6765\u8bf4&#xff1a;\u7531\u4e8e\u670d\u52a1\u5668A\u7684\u529f\u80fd\u7b80\u5355&#xff0c;\u5c31\u4f20\u9012\u6570\u636e\u7ed9\u5bf9\u5e94\u7684\u529f\u80fd\u670d\u52a1\u5668&#xff0c;\u90a3\u4e48\u5b83\u7684\u6297\u538b\u80fd\u529b\u5c31\u66f4\u5f3a&#xff0c;\u800cBC\u670d\u52a1\u5668\u7684\u529f\u80fd\u590d\u6742&#xff0c;\u9700\u8981\u6d88\u8017\u66f4\u591a\u7684\u8d44\u6e90&#xff0c;\u6240\u4ee5\u6297\u538b\u80fd\u529b\u66f4\u5dee&#xff1b;\u00a0<\/p>\n<p>\u670d\u52a1\u5668\u6302\u6389\u539f\u56e0&#xff1a;<\/p>\n<p>\u7531\u4e8e\u670d\u52a1\u5668\u8981\u5904\u7406\u6bcf\u4e2a\u8bf7\u6c42&#xff0c;\u6240\u4ee5\u9700\u8981\u6d88\u8017\u786c\u4ef6\u8d44\u6e90&#xff0c;\u8fd9\u91cc\u5305\u62ec&#xff08;CPU&#xff0c;\u786c\u76d8&#xff0c;\u5185\u5b58&#xff0c;\u548c\u7f51\u7edc\u5e26\u5bbd&#xff09;&#xff0c;\u6b64\u65f6\u5176\u4e2d\u4e00\u4e2a\u786c\u4ef6\u8d44\u6e90\u8fbe\u5230\u74f6\u9888&#xff0c;\u90a3\u4e48\u6b64\u65f6\u5c31\u4e0d\u4f1a\u5bf9\u8bf7\u6c42\u505a\u51fa\u54cd\u5e94\u4e86&#xff0c;\u5c31\u5bfc\u81f4\u670d\u52a1\u5668\u6302\u6389\u4e86<\/p>\n<p>\u5f53\u6211\u4eec\u5f15\u5165\u963b\u585e\u961f\u5217\u65f6&#xff1a;<\/p>\n<p>\u6b64\u65f6\u670d\u52a1\u5668A\u7684\u6570\u636e\u4f20\u9012\u7ed9\u963b\u585e\u961f\u5217&#xff0c;\u7531\u4e8e\u963b\u585e\u961f\u5217\u53ea\u662f\u7528\u4e8e\u5b58\u8d2e\u6570\u636e&#xff0c;\u6240\u4ee5\u6297\u538b\u80fd\u529b\u66f4\u5f3a&#xff0c;\u53ef\u4ee5\u63a7\u5236\u8bf7\u6c42\u4f20\u7ed9\u529f\u80fd\u670d\u52a1\u5668\u7684\u901f\u5ea6&#xff0c;\u9632\u6b62\u670d\u52a1\u5668B\u548cC\u88ab\u5927\u91cf\u7684\u8bf7\u6c42\u51b2\u51fb\u800c\u57ae\u6389~~~<\/p>\n<h4 id=\"2.3%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E4%BB%A3%E4%BB%B7\">2.3\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u4ee3\u4ef7<\/h4>\n<p><span style=\"background-color:#ffd900\">1.\u4e0a\u8ff0\u63cf\u8ff0\u7684\u963b\u585e\u961f\u5217&#xff0c;\u662f\u4ee5\u8fd9\u4e2a\u6570\u636e\u7ed3\u6784\u6765\u5b9e\u73b0\u7684\u7684\u670d\u52a1\u5668\u7ed3\u6784&#xff0c;\u4f1a\u90e8\u7f72\u5230\u5355\u72ec\u7684\u4e3b\u673a\u4e0a<\/span><\/p>\n<p><span style=\"background-color:#ffd900\">2.\u6574\u4e2a\u7cfb\u7edf\u7684\u7ed3\u6784\u53d8\u5f97\u590d\u6742&#xff0c;\u9700\u8981\u7ef4\u62a4\u7684\u670d\u52a1\u5668\u5c31\u66f4\u591a&#xff0c;\u6210\u672c\u53d8\u9ad8\u4e86&#xff1b;<\/span><\/p>\n<p><span style=\"background-color:#ffd900\">3.\u901a\u8fc7\u963b\u585e\u961f\u5217&#xff0c;\u5b9e\u73b0A\u5230B\u7684\u6570\u636e\u4f20\u8f93\u7684\u8f6c\u5316&#xff0c;\u9700\u8981\u4e00\u5b9a\u7684\u5f00\u9500&#xff0c;\u5f71\u54cd\u6548\u7387<\/span><\/p>\n<h4 id=\"2.4%E7%94%9F%E4%BA%A7%E8%80%85%E6%B6%88%E8%B4%B9%E8%80%85%E6%A8%A1%E5%9E%8B%E6%A8%A1%E6%8B%9F\" style=\"background-color:transparent\">2.4\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u6a21\u62df<\/h4>\n<p>\u6b64\u65f6\u6211\u4eec\u5c31\u8981\u7528\u4e00\u4e2a\u7ebf\u7a0b\u8c03\u7528\u963b\u585e\u961f\u5217\u7684\u5165\u961f\u5217\u6a21\u4eff\u751f\u4ea7\u8005&#xff0c;\u4e00\u4e2a\u7ebf\u7a0b\u8c03\u7528\u51fa\u961f\u5217\u6a21\u4eff\u6d88\u8d39\u8005<\/p>\n<p>\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p> public static void main(String[] args) {<br \/>\n        Myblockingqueue queue&#061;new Myblockingqueue(100);<br \/>\n        \/\/\u8fdb\u884c\u4e24\u4e2a\u7ebf\u7a0b\u7684\u6d4b\u8bd5<br \/>\n        Thread t1&#061;new Thread(()-&gt;{<br \/>\n            int n&#061;1;<br \/>\n            while (true){<br \/>\n                try {<br \/>\n                    queue.put(n);<br \/>\n                    System.out.println(&#034;\u751f\u4ea7\u7684\u5143\u7d20&#034;&#043;n);<br \/>\n                    n&#043;&#043;;\/\/\u5f53\u592a\u591a\u4e86\u5c31\u8fdb\u5165\u963b\u585e<br \/>\n                } catch (InterruptedException e) {<br \/>\n                    throw new RuntimeException(e);<br \/>\n                }<\/p>\n<p>            }<br \/>\n        });<br \/>\n        Thread t2&#061;new Thread(()-&gt;{<br \/>\n            while (true){<br \/>\n                try {<br \/>\n                    Thread.sleep(500);<br \/>\n                    int n&#061;queue.take();<br \/>\n                    System.out.println(&#034;\u6d88\u8d39\u7684\u5143\u7d20&#034;&#043;n);<br \/>\n                } catch (InterruptedException e) {<br \/>\n                    throw new RuntimeException(e);<br \/>\n                }<br \/>\n            }<br \/>\n        });<br \/>\n        t1.start();<br \/>\n        t2.start();<br \/>\n    }<\/p>\n<p>\u89e3\u91ca&#xff1a;\u6b64\u65f6\u4ee3\u7801\u7531\u4e8e\u6d88\u8d39\u8005\u7684\u6d88\u8d39\u8fdb\u884c\u4e86\u4f11\u7720\u64cd\u4f5c&#xff0c;\u90a3\u4e48\u8f93\u51fa\u5c31\u662f\u73b0\u751f\u4ea7\u5927\u91cf\u7684\u5143\u7d20&#xff0c;\u7136\u540e\u6d88\u8d39\u4e00\u4e2a\u751f\u4ea7\u4e00\u4e2a&#xff1b;<\/p>\n<p>\u5982\u56fe&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"286\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102337-68022829ac4bb.png\" width=\"461\" \/><\/p>\n<p>\u8fd9\u91cc\u5c0f\u7f16\u53ea\u663e\u793a\u4e86\u4e00\u90e8\u5206\u8f93\u51fa&#xff1b;<\/p>\n<p>\u5982\u679c\u5c06\u4f11\u7720\u653e\u5728\u751f\u4ea7\u90e8\u5206&#xff0c;\u90a3\u4e48\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<p> Thread t1&#061;new Thread(()-&gt;{<br \/>\n            int n&#061;1;<br \/>\n            while (true){<br \/>\n                try {<br \/>\n                    queue.put(n);<br \/>\n                    System.out.println(&#034;\u751f\u4ea7\u7684\u5143\u7d20&#034;&#043;n);<br \/>\n                    n&#043;&#043;;\/\/\u5f53\u592a\u591a\u4e86\u5c31\u8fdb\u5165\u963b\u585e<br \/>\n                    Thread.sleep(500);<br \/>\n                } catch (InterruptedException e) {<br \/>\n                    throw new RuntimeException(e);<br \/>\n                }<\/p>\n<p>            }<br \/>\n        }); <\/p>\n<p>\u90a3\u4e48\u8f93\u51fa\u5c31\u662f&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"262\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102337-68022829bce2e.png\" width=\"511\" \/><\/p>\n<p>\u6d88\u8d39\u4e00\u4e2a&#xff0c;\u751f\u4ea7\u4e00\u4e2a~~~<\/p>\n<h3 id=\"%F0%9F%93%9A%EF%B8%8F3%E6%80%BB%E7%BB%93\">&#x1f4da;\ufe0f3\u603b\u7ed3<\/h3>\n<p>&#x1f4ac;&#x1f4ac;\u5c0f\u7f16\u672c\u671f\u8bb2\u89e3\u4e86\u5173\u4e8e\u963b\u585e\u961f\u5217\u7684\u7279\u6027&#xff0c;\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u5b58\u5728\u7684\u95ee\u9898&#xff0c;\u4ee5\u53ca\u89e3\u51b3\u548c\u4ee3\u7801\u7684\u5b9e\u73b0&#xff0c;\u5e76\u4e14\u8fd8\u5229\u7528\u4e86\u963b\u585e\u961f\u5217\u5b9e\u73b0\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b&#xff1b;\u5e76\u4e14\u8fd8\u7406\u89e3\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u4f5c\u7528<\/p>\n<p><span style=\"color:#38d8f0\">&#x1f305;&#x1f305;&#x1f305;~~~~\u6700\u540e\u5e0c\u671b\u4e0e\u8bf8\u541b\u5171\u52c9&#xff0c;\u5171\u540c\u8fdb\u6b65&#xff01;&#xff01;&#xff01;<\/span>\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"313\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102337-68022829cd220.jpg\" width=\"450\" \/><\/p>\n<hr \/>\n<p style=\"text-align:center\"><span style=\"color:#38d8f0\">&#x1f4aa;&#x1f4aa;&#x1f4aa;\u4ee5\u4e0a\u5c31\u662f\u672c\u671f\u5185\u5bb9\u4e86&#xff0c; \u611f\u5174\u8da3\u7684\u8bdd&#xff0c;\u5c31\u5173\u6ce8\u5c0f\u7f16\u5427\u3002<\/span><\/p>\n<p style=\"text-align:center\"><span style=\"color:#38d8f0\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#x1f60a;&#x1f60a; \u00a0\u671f\u5f85\u4f60\u7684\u5173\u6ce8~~~<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb5.2k\u6b21\uff0c\u70b9\u8d5e130\u6b21\uff0c\u6536\u85cf93\u6b21\u3002\u672c\u671f\u8bb2\u89e3\u4e86\u5173\u4e8e\u963b\u585e\u961f\u5217\u7684\u7279\u6027\uff0c\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u5b58\u5728\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u89e3\u51b3\u548c\u4ee3\u7801\u7684\u5b9e\u73b0\uff0c\u5e76\u4e14\u8fd8\u5229\u7528\u4e86\u963b\u585e\u961f\u5217\u5b9e\u73b0\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\uff1b\u5e76\u4e14\u8fd8\u7406\u89e3\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u4f5c\u7528_\u7ebf\u7a0b\u6c60\u963b\u585e \u4f1a\u5bfc\u81f4\u670d\u52a1\u5d29\u5417<\/p>\n","protected":false},"author":2,"featured_media":11011,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,358,190,512,511,510],"topic":[],"class_list":["post-11023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-javaee","tag-190","tag-512","tag-511","tag-510"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/11023.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb5.2k\u6b21\uff0c\u70b9\u8d5e130\u6b21\uff0c\u6536\u85cf93\u6b21\u3002\u672c\u671f\u8bb2\u89e3\u4e86\u5173\u4e8e\u963b\u585e\u961f\u5217\u7684\u7279\u6027\uff0c\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u5b58\u5728\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u89e3\u51b3\u548c\u4ee3\u7801\u7684\u5b9e\u73b0\uff0c\u5e76\u4e14\u8fd8\u5229\u7528\u4e86\u963b\u585e\u961f\u5217\u5b9e\u73b0\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\uff1b\u5e76\u4e14\u8fd8\u7406\u89e3\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u4f5c\u7528_\u7ebf\u7a0b\u6c60\u963b\u585e \u4f1a\u5bfc\u81f4\u670d\u52a1\u5d29\u5417\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/11023.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T10:23:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-6802282840e21.gif\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/11023.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/11023.html\",\"name\":\"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T10:23:39+00:00\",\"dateModified\":\"2025-04-18T10:23:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/11023.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/11023.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/11023.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/11023.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb5.2k\u6b21\uff0c\u70b9\u8d5e130\u6b21\uff0c\u6536\u85cf93\u6b21\u3002\u672c\u671f\u8bb2\u89e3\u4e86\u5173\u4e8e\u963b\u585e\u961f\u5217\u7684\u7279\u6027\uff0c\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u5b58\u5728\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u89e3\u51b3\u548c\u4ee3\u7801\u7684\u5b9e\u73b0\uff0c\u5e76\u4e14\u8fd8\u5229\u7528\u4e86\u963b\u585e\u961f\u5217\u5b9e\u73b0\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\uff1b\u5e76\u4e14\u8fd8\u7406\u89e3\u4e86\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u4f5c\u7528_\u7ebf\u7a0b\u6c60\u963b\u585e \u4f1a\u5bfc\u81f4\u670d\u52a1\u5d29\u5417","og_url":"https:\/\/www.wsisp.com\/helps\/11023.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T10:23:39+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418102336-6802282840e21.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/11023.html","url":"https:\/\/www.wsisp.com\/helps\/11023.html","name":"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T10:23:39+00:00","dateModified":"2025-04-18T10:23:39+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/11023.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/11023.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/11023.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010JavaEE\u521d\u9636\u3011\u6df1\u5165\u7406\u89e3\u591a\u7ebf\u7a0b\u963b\u585e\u961f\u5217\u7684\u539f\u7406\uff0c\u5982\u4f55\u5b9e\u73b0\u751f\u4ea7\u8005-\u6d88\u8d39\u8005\u6a21\u578b\uff0c\u4ee5\u53ca\u670d\u52a1\u5668\u5d29\u6389\u539f\u56e0\uff01\uff01\uff01"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/11023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=11023"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/11023\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/11011"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=11023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=11023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=11023"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=11023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}