{"id":115335,"date":"2026-10-11T23:09:01","date_gmt":"2026-10-11T15:09:01","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/115335.html"},"modified":"2026-10-11T23:09:01","modified_gmt":"2026-10-11T15:09:01","slug":"java%e9%9d%a2%e8%af%95%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/115335.html","title":{"rendered":"java\u9762\u8bd5\u9898"},"content":{"rendered":"<h2 style=\"margin-left:0px;margin-right:0px;text-align:center\">JAVA \u590d\u4e60\u9898<\/h2>\n<h3 style=\"margin-left:0px;margin-right:0px\">\u7b80\u5355\u9898<\/h3>\n<h4 style=\"margin-left:0px;margin-right:0px\">1. \u8ba1\u7b97\u673a\u7f51\u7edc\u4f20\u8f93\u5c42\u6709\u54ea\u4e9b\u534f\u8bae&#xff1f;\u5206\u522b\u9002\u7528\u4e8e\u4ec0\u4e48\u573a\u666f&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f20\u8f93\u5c42\u6838\u5fc3\u534f\u8bae&#xff1a;TCP\u3001UDP<\/p>\n<ul>\n<li>TCP&#xff1a;\u9762\u5411\u8fde\u63a5\u3001\u53ef\u9760\u4f20\u8f93\u3002\u9002\u7528&#xff1a;\u6587\u4ef6\u4f20\u8f93\u3001\u7f51\u9875\u8bbf\u95ee\u3001\u6570\u636e\u5e93\u8fde\u63a5&#xff08;\u9700\u8981\u6570\u636e\u4e0d\u4e22\u5931\u3001\u987a\u5e8f\u6b63\u786e&#xff09;\u3002<\/li>\n<li>UDP&#xff1a;\u65e0\u8fde\u63a5\u3001\u4e0d\u53ef\u9760&#xff0c;\u5f00\u9500\u5c0f\u3002\u9002\u7528&#xff1a;\u76f4\u64ad\u3001\u89c6\u9891\u901a\u8bdd\u3001DNS\u67e5\u8be2\u3001\u6e38\u620f&#xff08;\u5141\u8bb8\u5c11\u91cf\u4e22\u5305&#xff0c;\u4f18\u5148\u901f\u5ea6&#xff09;\u3002<\/li>\n<\/ul>\n<h4 style=\"margin-left:0px;margin-right:0px\">2. \u591a\u7ebf\u7a0b\u7684\u4f7f\u7528\u573a\u666f\u6709\u54ea\u4e9b&#xff1f;\u7ebf\u7a0b\u5f00\u542f\u591a\u5c11\u4e2a\u5408\u9002&#xff1f;\u5224\u65ad\u6807\u51c6\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u573a\u666f&#xff1a;IO\u5bc6\u96c6\u578b&#xff08;\u6587\u4ef6\u8bfb\u5199\u3001\u7f51\u7edc\u8bf7\u6c42&#xff09;\u3001\u540e\u53f0\u5f02\u6b65\u4efb\u52a1\u3001\u5e76\u884c\u8ba1\u7b97\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u7ebf\u7a0b\u6570\u91cf&#xff1a;<\/p>\n<ul>\n<li>CPU\u5bc6\u96c6\u578b&#xff1a;\u6838\u5fc3\u6570&#043;1&#xff1b;<\/li>\n<li>IO\u5bc6\u96c6\u578b&#xff1a;2*CPU\u6838\u5fc3\u6570\u3002 \u5224\u65ad\u6807\u51c6&#xff1a;\u770bCPU\u5229\u7528\u7387\u3001IO\u7b49\u5f85\u65f6\u95f4&#xff0c;\u51cf\u5c11\u7ebf\u7a0b\u4e0a\u4e0b\u6587\u5207\u6362&#xff0c;\u907f\u514d\u8fc7\u591a\u7ebf\u7a0b\u62a2\u5360\u8d44\u6e90\u3002<\/li>\n<\/ul>\n<h4 style=\"margin-left:0px;margin-right:0px\">3. \u7ebf\u7a0b\u6c60\u7684\u63d0\u4ea4\u65b9\u5f0f\u6709\u54ea\u51e0\u79cd&#xff1f;<\/h4>\n<li>execute(Runnable)&#xff1a;\u65e0\u8fd4\u56de\u503c&#xff0c;\u629b\u51fa\u5f02\u5e38\u76f4\u63a5\u5411\u5916\u629b\u51fa<\/li>\n<li>submit(Runnable)&#xff1a;\u8fd4\u56deFuture\u5bf9\u8c61&#xff0c;\u53ef\u4ee5\u6355\u83b7\u5f02\u5e38<\/li>\n<li>submit(Runnable, T result)<\/li>\n<li>submit(Callable)&#xff1a;\u5e26\u8fd4\u56de\u7ed3\u679c&#xff0c;\u901a\u8fc7Future\u83b7\u53d6\u8fd4\u56de\u503c<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">4. \u9501\u7684\u5b9e\u73b0\u539f\u7406\u4ecb\u7ecd\u4e00\u4e0b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4ee5synchronized\u4e3a\u4f8b&#xff1a;\u5bf9\u8c61\u5934\u5305\u542bMark Word&#xff0c;\u5b58\u653e\u9501\u6807\u8bb0\u3002 \u65e0\u9501\u2192\u504f\u5411\u9501\u2192\u8f7b\u91cf\u7ea7\u9501&#xff08;CAS\u81ea\u65cb&#xff09;\u2192\u91cd\u91cf\u7ea7\u9501&#xff08;OS\u4e92\u65a5\u9501&#xff09;\u3002 \u5e95\u5c42&#xff1a;CAS &#043; \u5bf9\u8c61\u5934MarkWord &#043; \u64cd\u4f5c\u7cfb\u7edf\u4e92\u65a5\u539f\u8bed\u3002\u901a\u8fc7\u7ade\u4e89\u9501&#xff0c;\u4fdd\u8bc1\u540c\u4e00\u65f6\u95f4\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c\u4e34\u754c\u533a\u4ee3\u7801&#xff0c;\u4fdd\u8bc1\u539f\u5b50\u6027\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">5. TCP\u534f\u8bae\u4e2d\u62e5\u585e\u63a7\u5236\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u9632\u6b62\u53d1\u9001\u65b9\u53d1\u9001\u6570\u636e\u592a\u5feb&#xff0c;\u9020\u6210\u7f51\u7edc\u62e5\u5835\u3001\u62a5\u6587\u5927\u91cf\u4e22\u5931\u3002\u52a8\u6001\u8c03\u6574\u62e5\u585e\u7a97\u53e3\u5927\u5c0f&#xff0c;\u63a7\u5236\u53d1\u9001\u901f\u7387&#xff0c;\u907f\u514d\u7f51\u7edc\u8fc7\u8f7d\u3002\u56db\u4e2a\u9636\u6bb5&#xff1a;\u6162\u542f\u52a8\u3001\u62e5\u585e\u907f\u514d\u3001\u5feb\u91cd\u4f20\u3001\u5feb\u6062\u590d\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">6. String\u7c7b\u7684\u5e38\u7528\u51fd\u6570\u6709\u54ea\u4e9b&#xff1f;\u5217\u4e3e\u5341\u79cd\u3002<\/h4>\n<p style=\"margin-left:0;margin-right:0\">length()\u3001charAt()\u3001substring()\u3001indexOf()\u3001lastIndexOf()\u3001equals()\u3001equalsIgnoreCase()\u3001trim()\u3001split()\u3001replace()\u3001toUpperCase()\u3001toLowerCase()<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">7. String\u548cStringBuffer,StringBuilder\u7684\u533a\u522b\u6709\u54ea\u4e9b&#xff1f;\u6240\u6709\u7c7b\u540d\u5305\u542bBuffer\u7684\u7c7b\u7684\u5185\u90e8\u5b9e\u73b0\u539f\u7406\u662f\u4ec0\u4e48&#xff1f;\u6709\u4ec0\u4e48\u4f18\u52bf&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"183\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261011150859-6acba68bbccdd.jpg\" width=\"829\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0<\/p>\n<li>\u7b2c\u4e00\u70b9: \u53ef\u53d8\u548c\u9002\u7528\u8303\u56f4\u3002String\u5bf9\u8c61\u662f\u4e0d\u53ef\u53d8\u7684&#xff0c;\u800cStringBuffer\u548cStringBuilder\u662f\u53ef\u53d8\u5b57\u7b26\u5e8f\u5217\u3002\u6bcf\u6b21\u5bf9String\u7684\u64cd\u4f5c\u76f8\u5f53\u4e8e\u751f\u6210\u4e00\u4e2a\u65b0\u7684String\u5bf9\u8c61&#xff0c;\u800c\u5bf9StringBuffer\u548cStringBuilder\u7684\u64cd\u4f5c\u662f\u5bf9\u5bf9\u8c61\u672c\u8eab\u7684\u64cd\u4f5c&#xff0c;\u800c\u4e0d\u4f1a\u751f\u6210\u65b0\u7684\u5bf9\u8c61&#xff0c;\u6240\u4ee5\u5bf9\u4e8e\u9891\u7e41\u6539\u53d8\u5185\u5bb9\u7684\u5b57\u7b26\u4e32\u907f\u514d\u4f7f\u7528String&#xff0c;\u56e0\u4e3a\u9891\u7e41\u7684\u751f\u6210\u5bf9\u8c61\u5c06\u4f1a\u5bf9\u7cfb\u7edf\u6027\u80fd\u4ea7\u751f\u5f71\u54cd\u3002<\/li>\n<li>\u7b2c\u4e8c\u70b9: \u7ebf\u7a0b\u5b89\u5168\u3002String\u7531\u4e8e\u6709final\u4fee\u9970&#xff0c;\u662fimmutable\u7684&#xff0c;\u5b89\u5168\u6027\u662f\u7b80\u5355\u800c\u7eaf\u7cb9\u7684\u3002StringBuilder\u548cStringBuffer\u7684\u533a\u522b\u5728\u4e8eStringBuilder\u4e0d\u4fdd\u8bc1\u540c\u6b65&#xff0c;\u4e5f\u5c31\u662f\u8bf4\u5982\u679c\u9700\u8981\u7ebf\u7a0b\u5b89\u5168\u9700\u8981\u4f7f\u7528StringBuffer&#xff0c;\u4e0d\u9700\u8981\u540c\u6b65\u7684StringBuilder\u6548\u7387\u66f4\u9ad8\u3002<\/li>\n<li>\u603b\u7ed3&#xff1a;\n<ul>\n<li>\u64cd\u4f5c\u5c11\u91cf\u7684\u6570\u636e &#061; String<\/li>\n<li>\u5355\u7ebf\u7a0b\u64cd\u4f5c\u5b57\u7b26\u4e32\u7f13\u51b2\u533a\u4e0b\u64cd\u4f5c\u5927\u91cf\u6570\u636e &#061; StringBuilder<\/li>\n<li>\u591a\u7ebf\u7a0b\u64cd\u4f5c\u5b57\u7b26\u4e32\u7f13\u51b2\u533a\u4e0b\u64cd\u4f5c\u5927\u91cf\u6570\u636e &#061; StringBuffer<\/li>\n<\/ul>\n<\/li>\n<p style=\"margin-left:0;margin-right:0\">\n<ul>\n<li>Buffer\u7c7b\u5e95\u5c42&#xff1a;\u53ef\u53d8\u5b57\u7b26\u6570\u7ec4&#xff0c;\u9884\u5206\u914d\u5bb9\u91cf&#xff0c;\u6269\u5bb9\u65f6\u65b0\u5efa\u6570\u7ec4\u590d\u5236\u5185\u5bb9\u3002\u4f18\u52bf&#xff1a;\u5b57\u7b26\u4e32\u62fc\u63a5\u4e0d\u4f1a\u9891\u7e41\u521b\u5efa\u65b0\u5bf9\u8c61&#xff0c;\u51cf\u5c11GC\u538b\u529b\u3002<\/li>\n<\/ul>\n<h4 style=\"margin-left:0px;margin-right:0px\">8. String\u5b57\u7b26\u4e32\u7684\u4e0d\u53ef\u53d8\u662f\u6307\u54ea\u91cc\u4e0d\u53ef\u53d8&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u5e95\u5c42\u5b58\u50a8\u5b57\u7b26\u7684value\u6570\u7ec4\u88abfinal\u4fee\u9970&#xff0c;\u6570\u7ec4\u5f15\u7528\u4e0d\u80fd\u6307\u5411\u65b0\u6570\u7ec4&#xff1b;\u6570\u7ec4\u5185\u5143\u7d20\u4e00\u65e6\u521d\u59cb\u5316&#xff0c;\u4e0d\u80fd\u4fee\u6539\u3002String\u5f15\u7528\u53d8\u91cf\u53ef\u4ee5\u91cd\u65b0\u8d4b\u503c&#xff0c;\u4e0d\u662f\u53d8\u91cf\u4e0d\u53ef\u53d8\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">9. HTTP\u534f\u8bae\u6709\u54ea\u4e9b\u5b57\u6bb5&#xff0c;\u5217\u4e3e3\u4e2a\u5c31\u53ef\u4ee5\u3002<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u8bf7\u6c42\u5934&#xff1a;Host\u3001User-Agent\u3001Content-Type\u3001Cookie\u3001Accept\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">10. Java\u5f02\u5e38\u7c7b\u6709\u54ea\u4e9b&#xff1f;\u5206\u522b\u7ba1\u7406\u4ec0\u4e48\u5f02\u5e38&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">Throwable\u5206\u4e24\u5927\u5206\u652f&#xff1a;<\/p>\n<li>Error&#xff1a;\u7cfb\u7edf\u7ea7\u4e25\u91cd\u9519\u8bef&#xff0c;OutOfMemoryError\u3001StackOverflowError&#xff0c;\u7a0b\u5e8f\u65e0\u6cd5\u5904\u7406\u3002<\/li>\n<li>Exception&#xff1a;\u7a0b\u5e8f\u53ef\u5904\u7406\u5f02\u5e38\n<ul>\n<li>\u53d7\u68c0\u5f02\u5e38&#xff08;\u7f16\u8bd1\u671f&#xff09;&#xff1a;IOException\u3001SQLException<\/li>\n<li>\u975e\u53d7\u68c0\u5f02\u5e38&#xff08;\u8fd0\u884c\u65f6RuntimeException&#xff09;&#xff1a;NullPointerException\u3001ArrayIndexOutOfBounds<\/li>\n<\/ul>\n<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">11. Java\u53cd\u5c04\u83b7\u53d6\u7c7b\u4fe1\u606f\u7684\u65b9\u5f0f\u6709\u54ea\u51e0\u79cd&#xff1f;\u5206\u522b\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<li>\u7c7b\u540d.class \u5982User.class<\/li>\n<li>\u5bf9\u8c61.getClass() \u5982userObj.getClass()<\/li>\n<li>Class.forName(&#034;\u5168\u7c7b\u540d&#034;) \u6700\u5e38\u7528&#xff0c;\u53ef\u52a8\u6001\u52a0\u8f7d\u7c7b<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">12. Java\u4ee3\u7406\u7684\u4e3b\u8981\u65b9\u6cd5\u6709\u54ea\u51e0\u79cd&#xff1f;\u5217\u4e3e\u4ee3\u7406\u7684\u4f7f\u7528\u573a\u666f2\u4e2a\u3002<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u9759\u6001\u4ee3\u7406\u3001JDK\u52a8\u6001\u4ee3\u7406\u3001CGLIB\u52a8\u6001\u4ee3\u7406\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u573a\u666f&#xff1a;AOP\u5207\u9762\u3001\u4e8b\u52a1\u63a7\u5236\u3001\u65e5\u5fd7\u8bb0\u5f55\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">13. equals()\u65b9\u6cd5\u7684\u4f5c\u7528\u662f\u4ec0\u4e48&#xff1f;\u91cd\u5199equals\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4e8b\u9879&#xff1f;\u4e3a\u4ec0\u4e48&#xff1f;<\/h4>\n<li>&#061;&#061;&#xff08;\u8865\u5145&#xff09;<\/li>\n<ul>\n<li>\u57fa\u672c\u6570\u636e\u7c7b\u578b&#xff1a;\u6bd4\u8f83\u6570\u503c&#xff08;\u503c&#xff09;<\/li>\n<li>\u5f15\u7528\u6570\u636e\u7c7b\u578b&#xff1a;\u6c38\u8fdc\u6bd4\u8f83\u5bf9\u8c61\u5185\u5b58\u5730\u5740<\/li>\n<\/ul>\n<li>equals()<\/li>\n<ul>\n<li>Object \u539f\u751f\u672a\u91cd\u5199&#xff1a;\u5e95\u5c42\u5c31\u662freturn this &#061;&#061; obj&#xff0c;\u6bd4\u8f83\u5185\u5b58\u5730\u5740\u3002<\/li>\n<li>String\u3001Integer \u7b49\u5305\u88c5\u7c7b&#xff1a;\u91cd\u5199 equals \u65b9\u6cd5&#xff0c;\u6bd4\u8f83\u5bf9\u8c61\u5185\u5bb9&#xff08;\u503c&#xff09;\u3002<\/li>\n<\/ul>\n<p style=\"margin-left:0;margin-right:0\">\u91cd\u5199\u8981\u6c42&#xff1a;<\/p>\n<li>\u81ea\u53cd\u6027\u3001\u5bf9\u79f0\u6027\u3001\u4f20\u9012\u6027\u3001\u4e00\u81f4\u6027&#xff1b;<\/li>\n<li>\u91cd\u5199equals\u5fc5\u987b\u91cd\u5199hashCode\u3002 \u539f\u56e0&#xff1a;\u5982\u679c\u4e24\u4e2a\u5bf9\u8c61equals\u76f8\u7b49&#xff0c;hashCode\u5fc5\u987b\u76f8\u7b49&#xff0c;\u5426\u5219HashMap\u7b49\u96c6\u5408\u4f1a\u51fa\u9519\u3002<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">14. Java\u662f\u6309\u503c\u4f20\u9012\u8fd8\u662f\u6309\u5f15\u7528\u4f20\u9012&#xff1f;\u4ec0\u4e48\u662f\u5f15\u7528\u4f20\u9012&#xff0c;\u4ec0\u4e48\u662f\u503c\u4f20\u9012&#xff0c;\u54ea\u4e9b\u8bed\u8a00\u652f\u6301\u5f15\u7528\u4f20\u9012&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">Java\u53ea\u6709\u503c\u4f20\u9012\u3002 \u503c\u4f20\u9012&#xff1a;\u4f20\u9012\u7684\u662f\u526f\u672c&#xff0c;\u65b9\u6cd5\u5185\u4fee\u6539\u526f\u672c\u4e0d\u5f71\u54cd\u539f\u53d8\u91cf\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5f15\u7528\u4f20\u9012&#xff1a;\u4f20\u9012\u53d8\u91cf\u672c\u8eab\u7684\u5730\u5740&#xff0c;\u65b9\u6cd5\u5185\u4fee\u6539\u4f1a\u76f4\u63a5\u4fee\u6539\u539f\u59cb\u53d8\u91cf\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">C&#043;&#043;\u3001C#\u652f\u6301\u5f15\u7528\u4f20\u9012\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">Java\u4f20\u9012\u5f15\u7528\u7c7b\u578b\u65f6&#xff0c;\u4f20\u9012\u7684\u662f\u5f15\u7528\u5730\u5740\u526f\u672c&#xff0c;\u4ecd\u7136\u5c5e\u4e8e\u503c\u4f20\u9012\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">15. \u63cf\u8ff0java\u7684\u7c7b\u521d\u59cb\u5316\u987a\u5e8f&#xff1f;\u5982\u679c\u5b58\u5728\u7ee7\u627f&#xff0c;\u521d\u59cb\u5316\u987a\u5e8f\u4f1a\u5982\u4f55<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u65e0\u7ee7\u627f&#xff1a;\u9759\u6001\u53d8\u91cf\/\u9759\u6001\u4ee3\u7801\u5757 \u2192 \u6210\u5458\u53d8\u91cf\/\u6784\u9020\u4ee3\u7801\u5757 \u2192 \u6784\u9020\u65b9\u6cd5\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6709\u7ee7\u627f&#xff1a;\u7236\u7c7b\u9759\u6001 \u2192 \u5b50\u7c7b\u9759\u6001 \u2192 \u7236\u7c7b\u6210\u5458\u3001\u6784\u9020\u5757 \u2192 \u7236\u7c7b\u6784\u9020 \u2192 \u5b50\u7c7b\u6210\u5458\u3001\u6784\u9020\u5757 \u2192 \u5b50\u7c7b\u6784\u9020\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u9759\u6001\u53ea\u52a0\u8f7d\u4e00\u6b21\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">16. \u672c\u5730\u65b9\u6cd5\u6808\u6709\u4ec0\u4e48\u4f5c\u7528&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4e3anative\u672c\u5730\u65b9\u6cd5&#xff08;C\/C&#043;&#043;\u5199\u7684\u65b9\u6cd5&#xff09;\u670d\u52a1&#xff0c;\u5b58\u653enative\u65b9\u6cd5\u7684\u5c40\u90e8\u53d8\u91cf\u3001\u8fd4\u56de\u5730\u5740\u3002JVM\u8c03\u7528\u64cd\u4f5c\u7cfb\u7edf\u5e95\u5c42\u65b9\u6cd5\u65f6\u4f7f\u7528\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">17. \u63cf\u8ff0Java\u7684\u53cc\u4eb2\u59d4\u6d3e\u673a\u5236&#xff0c;\u4e3a\u4ec0\u4e48\u8981\u7528\u5230\u53cc\u4eb2\u59d4\u6d3e\u673a\u5236<\/h4>\n<p style=\"margin-left:0;margin-right:0\">Java\u53cc\u4eb2\u59d4\u6d3e\u673a\u5236\u662f\u6307\u5728\u7c7b\u52a0\u8f7d\u8fc7\u7a0b\u4e2d&#xff0c;\u7c7b\u52a0\u8f7d\u5668\u4f1a\u6309\u7167\u4e00\u5b9a\u7684\u987a\u5e8f\u59d4\u6d3e\u7ed9\u7236\u7c7b\u52a0\u8f7d\u5668\u6765\u5c1d\u8bd5\u52a0\u8f7d\u7c7b\u3002\u8fd9\u4e2a\u673a\u5236\u53ef\u4ee5\u786e\u4fdd\u7c7b\u7684\u52a0\u8f7d\u5b89\u5168\u548c\u9632\u6b62\u7c7b\u7684\u91cd\u590d\u52a0\u8f7d\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u8981\u89e3\u7b54\u6838\u5fc3\u77e5\u8bc6\u7684\u8868\u683c&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"228\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261011150900-6acba68c184d0.jpg\" width=\"830\" \/><\/p>\n<p style=\"margin-left:0;margin-right:0\">\u901a\u8fc7Java\u53cc\u4eb2\u59d4\u6d3e\u673a\u5236&#xff0c;\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u52a0\u8f7d\u7684\u5b89\u5168\u6027\u548c\u907f\u514d\u91cd\u590d\u52a0\u8f7d&#xff0c;\u540c\u65f6\u4e5f\u5141\u8bb8\u5f00\u53d1\u8005\u81ea\u5b9a\u4e49ClassLoader\u6765\u5b9e\u73b0\u7279\u5b9a\u9700\u6c42\u7684\u7c7b\u52a0\u8f7d\u884c\u4e3a\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">18. \u91cd\u5199\u548c\u91cd\u8f7d\u7684\u533a\u522b\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<li>\u91cd\u8f7d\u5c31\u662f\u540c\u4e00\u4e2a\u7c7b\u4e2d&#xff0c;\u6709\u591a\u4e2a\u65b9\u6cd5\u540d\u76f8\u540c&#xff0c;\u4f46\u53c2\u6570\u5217\u8868\u4e0d\u540c&#xff08;\u5305\u62ec\u53c2\u6570\u4e2a\u6570\u548c\u53c2\u6570\u7c7b\u578b&#xff09;&#xff0c;\u4e0e\u8fd4\u56de\u503c\u65e0\u5173&#xff0c;\u4e0e\u6743\u9650\u4fee\u9970\u7b26\u4e5f\u65e0\u5173\u3002\u8c03\u7528\u91cd\u8f7d\u7684\u65b9\u6cd5\u65f6\u901a\u8fc7\u4f20\u9012\u7ed9\u5b83\u4eec\u4e0d\u540c\u7684\u53c2\u6570\u4e2a\u6570\u548c\u53c2\u6570\u7c7b\u578b\u6765\u51b3\u5b9a\u5177\u4f53\u4f7f\u7528\u54ea\u4e2a\u65b9\u6cd5&#xff0c;\u8fd9\u53eb\u591a\u6001\u3002<\/li>\n<li>\u91cd\u5199\u5c31\u662f\u5b50\u7c7b\u91cd\u5199\u57fa\u7c7b\u7684\u65b9\u6cd5&#xff0c;\u65b9\u6cd5\u540d&#xff0c;\u53c2\u6570\u5217\u8868\u548c\u8fd4\u56de\u503c\u90fd\u5fc5\u987b\u76f8\u540c&#xff0c;\u5426\u5219\u5c31\u4e0d\u662f\u91cd\u5199\u800c\u662f\u91cd\u8f7d\u3002\u6743\u9650\u4fee\u9970\u7b26\u4e0d\u80fd\u5c0f\u4e8e\u88ab\u91cd\u5199\u65b9\u6cd5\u7684\u4fee\u9970\u7b26\u3002\u91cd\u5199\u65b9\u6cd5\u4e0d\u80fd\u629b\u51fa\u65b0\u7684\u5f02\u5e38\u6216\u8005\u662f\u6bd4\u88ab\u91cd\u5199\u65b9\u6cd5\u58f0\u660e\u66f4\u52a0\u5bbd\u6cdb\u7684\u68c0\u67e5\u578b\u5f02\u5e38\u3002<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">19. \u5b50\u7c7b\u6784\u9020\u65b9\u6cd5\u8c03\u7528\u7236\u7c7b\u6784\u9020\u65b9\u6cd5\u7684\u6ce8\u610f\u4e8b\u9879\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<li>super()\u5fc5\u987b\u653e\u5728\u5b50\u7c7b\u6784\u9020\u65b9\u6cd5\u7b2c\u4e00\u884c&#xff1b;<\/li>\n<li>\u5982\u679c\u7236\u7c7b\u65e0\u65e0\u53c2\u6784\u9020&#xff0c;\u5b50\u7c7b\u5fc5\u987b\u663e\u5f0f\u8c03\u7528\u7236\u7c7b\u6709\u53c2super&#xff1b;<\/li>\n<li>super\u548cthis\u4e0d\u80fd\u540c\u65f6\u51fa\u73b0\u5728\u540c\u4e00\u4e2a\u6784\u9020\u5668\u3002<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">20. \u5b50\u7c7b\u5b9e\u4f8b\u521d\u59cb\u5316\u662f\u5426\u89e6\u53d1\u53d1\u7236\u7c7b\u5b9e\u4f8b\u521d\u59cb\u5316&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f1a\u3002 \u521b\u5efa\u5b50\u7c7b\u5bf9\u8c61&#xff0c;\u4e00\u5b9a\u4f1a\u5148\u521d\u59cb\u5316\u7236\u7c7b\u5b9e\u4f8b\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">21. instanceof\u5173\u952e\u5b57\u7684\u4f5c\u7528\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u5224\u65ad\u5bf9\u8c61\u662f\u4e0d\u662f\u67d0\u4e2a\u7c7b&#xff08;\u6216\u5b50\u7c7b&#xff09;\u7684\u5b9e\u4f8b\u3002obj instanceof User&#xff0c;\u8fd4\u56de\u5e03\u5c14\u503c\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">22. \u57fa\u672c\u7c7b\u578b\u7684\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u662f\u5426\u4f1a\u4e22\u5931\u7cbe\u5ea6&#xff1f;\u5f15\u7528\u7c7b\u578b\u7684\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u9700\u8981\u6ce8\u610f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u57fa\u672c\u7c7b\u578b&#xff1a;\u5927\u8303\u56f4\u8f6c\u5c0f\u8303\u56f4&#xff0c;\u4f1a\u4e22\u5931\u7cbe\u5ea6&#xff08;double\u2192int&#xff0c;long\u2192short&#xff09;\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5f15\u7528\u7c7b\u578b\u5f3a\u5236\u8f6c\u6362&#xff1a;\u53ea\u80fd\u5411\u4e0a\u8f6c\u578b&#xff08;\u81ea\u52a8&#xff09;&#xff1b;\u5411\u4e0b\u5f3a\u8f6c\u5fc5\u987b\u4fdd\u8bc1\u5bf9\u8c61\u5b9e\u9645\u7c7b\u578b\u662f\u76ee\u6807\u7c7b\/\u5b50\u7c7b&#xff0c;\u5426\u5219\u629b\u51faClassCastException\u3002\u5efa\u8bae\u914d\u5408instanceof\u5224\u65ad\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">23. \u91cd\u5165\u9501\u6709\u54ea\u4e9b&#xff1f;\u4e3a\u4ec0\u4e48\u8981\u6709\u91cd\u5165\u9501&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">synchronized\u3001ReentrantLock\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u4f5c\u7528&#xff1a;\u540c\u4e00\u4e2a\u7ebf\u7a0b\u62ff\u5230\u9501\u4e4b\u540e&#xff0c;\u518d\u6b21\u8fdb\u5165\u540c\u6b65\u4ee3\u7801\u5757&#xff0c;\u53ef\u4ee5\u518d\u6b21\u83b7\u53d6\u9501&#xff0c;\u4e0d\u4f1a\u81ea\u5df1\u6b7b\u9501\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">24. \u6307\u4ee4\u91cd\u6392\u5e8f\u7684\u4f18\u70b9\u662f\u4ec0\u4e48&#xff1f;\u7531\u4ec0\u4e48\u539f\u56e0\u5bfc\u81f4\u7684&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f18\u70b9&#xff1a;CPU\u4f18\u5316&#xff0c;\u8c03\u6574\u6307\u4ee4\u6267\u884c\u987a\u5e8f&#xff0c;\u5145\u5206\u5229\u7528CPU\u6d41\u6c34\u7ebf&#xff0c;\u63d0\u5347\u6267\u884c\u6027\u80fd\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u539f\u56e0&#xff1a;JVM\u7f16\u8bd1\u5668\u3001CPU\u5904\u7406\u5668\u4e3a\u4e86\u6027\u80fd\u505a\u7684\u4f18\u5316\u3002 volatile\u53ef\u4ee5\u7981\u6b62\u6307\u4ee4\u91cd\u6392\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">25. Arrays.sort()\u7684\u5185\u90e8\u539f\u7406\u4ecb\u7ecd\u4e00\u4e0b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">JDK8&#xff1a;<\/p>\n<ul>\n<li>\u57fa\u672c\u7c7b\u578b&#xff1a;\u53cc\u8f74\u5feb\u901f\u6392\u5e8f&#xff08;DualPivotQuicksort&#xff09;<\/li>\n<li>\u5f15\u7528\u7c7b\u578b&#xff1a;TimSort&#xff08;\u5f52\u5e76&#043;\u63d2\u5165\u6392\u5e8f&#xff09;&#xff0c;\u7a33\u5b9a\u6392\u5e8f\u3002<\/li>\n<\/ul>\n<h4 style=\"margin-left:0px;margin-right:0px\">26. \u5806\u6392\u5e8f\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u662f\u591a\u5c11&#xff0c;\u7a7a\u95f4\u590d\u6742\u5ea6\u662f\u591a\u5c11&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u65f6\u95f4\u590d\u6742\u5ea6&#xff1a;O(nlogn)&#xff0c;\u6700\u597d\u6700\u574f\u5e73\u5747\u90fd\u662fO(nlogn) \u7a7a\u95f4\u590d\u6742\u5ea6&#xff1a;O(1)&#xff0c;\u539f\u5730\u6392\u5e8f\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">27. \u5b57\u7b26\u4e32\u201casdasjkfkasgfgshaahsfaf\u201d\u7ecf\u8fc7\u54c8\u592b\u66fc\u7f16\u7801\u4e4b\u540e\u5b58\u50a8\u6bd4\u7279\u6570\u662f\u591a\u5c11&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u5b57\u7b26\u7edf\u8ba1&#xff1a;a:6&#xff0c;s:5&#xff0c;f:4&#xff0c;k:2&#xff0c;g:2&#xff0c;h:2&#xff0c;d:1&#xff0c;j:1<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u54c8\u592b\u66fc\u6811\u6784\u5efa&#xff1a; \u603b\u6bd4\u7279&#061; 61 &#043; 52 &#043;42 &#043;23 &#043;23 &#043;23 &#043;14 &#043;14 &#061; 46 bit\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">28. CPU\u9ad8\u901f\u7f13\u5b58\u7684\u4f18\u70b9\u548c\u7f3a\u70b9\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f18\u70b9&#xff1a;\u901f\u5ea6\u6781\u5feb&#xff0c;\u51cf\u5c11\u8bbf\u95ee\u5185\u5b58\u8017\u65f6&#xff0c;\u63d0\u5347CPU\u541e\u5410\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u7f3a\u70b9&#xff1a;\u5bb9\u91cf\u5c0f&#xff1b;\u5b58\u5728\u7f13\u5b58\u4e00\u81f4\u6027\u95ee\u9898&#xff1b;\u591a\u6838\u5fc3\u4e0b\u7f13\u5b58\u540c\u6b65\u5f00\u9500\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">29. \u7ebf\u7a0b\u5b89\u5168\u7684\u7c7b\u6709\u54ea\u4e9b&#xff1f;\u5217\u4e3e2\u4e2a\u4ee5\u4e0a\u5c31\u53ef\u4ee5<\/h4>\n<p style=\"margin-left:0;margin-right:0\">Vector\u3001HashTable\u3001StringBuffer\u3001ConcurrentHashMap<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">30. \u4ec0\u4e48\u662fLRU\u7b97\u6cd5&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u6700\u8fd1\u6700\u5c11\u4f7f\u7528\u3002\u7f13\u5b58\u6ee1\u65f6&#xff0c;\u6dd8\u6c70\u6700\u957f\u65f6\u95f4\u6ca1\u6709\u88ab\u8bbf\u95ee\u7684\u6570\u636e\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6838\u5fc3\u601d\u60f3&#xff1a;\u4fdd\u7559\u70ed\u70b9\u6570\u636e&#xff0c;\u6dd8\u6c70\u51b7\u6570\u636e\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">31. TCP\u534f\u8bae\u6709\u54ea\u4e9b\u534f\u8bae\u5b57\u6bb5&#xff1f;\u5982\u4f55\u4fdd\u969c\u53ef\u9760\u4f20\u8f93\u7684&#xff1f;\u6ed1\u52a8\u7a97\u53e3\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u5b57\u6bb5&#xff1a;\u5e8f\u53f7\u3001\u786e\u8ba4\u53f7\u3001\u6807\u5fd7\u4f4d\u3001\u7a97\u53e3\u5927\u5c0f\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u53ef\u9760\u4f20\u8f93&#xff1a;\u5e8f\u5217\u53f7&#043;ACK\u786e\u8ba4\u3001\u8d85\u65f6\u91cd\u4f20\u3001\u6821\u9a8c\u548c\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6ed1\u52a8\u7a97\u53e3&#xff1a;\u6d41\u91cf\u63a7\u5236&#xff0c;\u63a5\u6536\u65b9\u544a\u8bc9\u53d1\u9001\u65b9\u6700\u591a\u80fd\u63a5\u6536\u591a\u5c11\u6570\u636e&#xff0c;\u9632\u6b62\u53d1\u9001\u65b9\u53d1\u592a\u5feb\u6df9\u6ca1\u63a5\u6536\u7f13\u51b2\u533a\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">32. \u4ec0\u4e48\u662f\u4e09\u6b21\u63e1\u624b&#xff0c;\u4ec0\u4e48\u662f\u56db\u6b21\u6325\u624b\u3002<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4e09\u6b21\u63e1\u624b&#xff1a;\u5efa\u7acbTCP\u8fde\u63a5\u3002<\/p>\n<li>\u5ba2\u6237\u7aefSYN&#xff1b;2. \u670d\u52a1\u7aefSYN&#043;ACK&#xff1b;3.\u5ba2\u6237\u7aefACK\u3002<\/li>\n<p style=\"margin-left:0;margin-right:0\">\u56db\u6b21\u6325\u624b&#xff1a;\u65ad\u5f00TCP\u8fde\u63a5\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">1.\u5ba2\u6237\u7aefFIN&#xff1b;2.\u670d\u52a1\u7aefACK&#xff1b;3.\u670d\u52a1\u7aefFIN&#xff1b;4.\u5ba2\u6237\u7aefACK\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">33. \u4ec0\u4e48\u662f\u6df1\u62f7\u8d1d&#xff1f;\u4ec0\u4e48\u662f\u6d45\u62f7\u8d1d&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u6d45\u62f7\u8d1d&#xff1a;\u62f7\u8d1d\u5bf9\u8c61&#xff0c;\u5f15\u7528\u6210\u5458\u53d8\u91cf\u53ea\u590d\u5236\u5730\u5740&#xff0c;\u65b0\u65e7\u5bf9\u8c61\u5171\u7528\u5b50\u5bf9\u8c61\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6df1\u62f7\u8d1d&#xff1a;\u62f7\u8d1d\u6574\u4e2a\u5bf9\u8c61&#xff0c;\u6240\u6709\u5d4c\u5957\u5bf9\u8c61\u5168\u90e8\u65b0\u5efa\u72ec\u7acb\u526f\u672c&#xff0c;\u4fee\u6539\u4e92\u4e0d\u5f71\u54cd\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">34. \u8bbf\u95ee\u5668\u5982\u4f55\u4fdd\u969c\u7ebf\u7a0b\u5b89\u5168&#xff1f;\u4e3e\u4f8b\u8bf4\u660e\u3002<\/h4>\n<p style=\"margin-left:0;margin-right:0\">get\/set\u8bbf\u95ee\u65b9\u6cd5\u52a0synchronized\u9501&#xff0c;\u4fdd\u8bc1\u540c\u4e00\u65f6\u523b\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u8bfb\u5199\u53d8\u91cf\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">private int num;<\/p>\n<p style=\"margin-left:0;margin-right:0\">public synchronized void setNum(int v){num&#061;v;}<\/p>\n<p style=\"margin-left:0;margin-right:0\">public synchronized int getNum(){return num;}<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">35. \u62bd\u8c61\u7c7b\u548c\u63a5\u53e3\u7684\u4e0d\u540c\u70b9\u548c\u76f8\u540c\u70b9\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"315\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261011150900-6acba68c40aab.jpg\" width=\"829\" \/><\/p>\n<li>\u62bd\u8c61\u7c7b\u53ef\u4ee5\u63d0\u4f9b\u6210\u5458\u65b9\u6cd5\u7684\u5b9e\u73b0\u7ec6\u8282&#xff0c;\u800c\u63a5\u53e3\u4e2d\u53ea\u80fd\u5b58\u5728public abstract \u65b9\u6cd5&#xff1b;<\/li>\n<li>\u62bd\u8c61\u7c7b\u4e2d\u7684\u6210\u5458\u53d8\u91cf\u53ef\u4ee5\u662f\u5404\u79cd\u7c7b\u578b\u7684&#xff0c;\u800c\u63a5\u53e3\u4e2d\u7684\u6210\u5458\u53d8\u91cf\u53ea\u80fd\u662fpublic static final \u7c7b\u578b\u7684&#xff1b;\n<ul>\n<li>\u63a5\u53e3\u4e2d\u4e0d\u80fd\u542b\u6709\u9759\u6001\u4ee3\u7801\u5757\u4ee5\u53ca\u9759\u6001\u65b9\u6cd5&#xff0c;\u800c\u62bd\u8c61\u7c7b\u53ef\u4ee5\u6709\u9759\u6001\u4ee3\u7801\u5757\u548c\u9759\u6001\u65b9\u6cd5&#xff1b;<\/li>\n<\/ul>\n<\/li>\n<li>\u4e00\u4e2a\u7c7b\u53ea\u80fd\u7ee7\u627f\u4e00\u4e2a\u62bd\u8c61\u7c7b&#xff0c;\u800c\u4e00\u4e2a\u7c7b\u5374\u53ef\u4ee5\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3\u3002<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">36. final\u5173\u952e\u5b57\u80fd\u5426\u9632\u6b62\u6307\u4ee4\u91cd\u6392\u5e8f&#xff1f;\u80fd\u5426\u4ee3\u66ffvolatile?<\/h4>\n<p style=\"margin-left:0;margin-right:0\">final\u53ef\u4ee5\u7981\u6b62\u6784\u9020\u5bf9\u8c61\u5185\u7684\u6307\u4ee4\u91cd\u6392&#xff0c;\u4fdd\u8bc1\u5bf9\u8c61\u5b89\u5168\u53d1\u5e03&#xff1b;\u4f46\u662f\u4e0d\u80fd\u4ee3\u66ffvolatile\u3002volatile\u4fdd\u8bc1\u53ef\u89c1\u6027&#043;\u7981\u6b62\u8bfb\u5199\u91cd\u6392&#xff0c;final\u4e0d\u4fdd\u8bc1\u53d8\u91cf\u53ef\u89c1\u6027\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">37. static\u4fee\u9970\u7684\u6a21\u5757\u4ec0\u4e48\u65f6\u5019\u5f00\u59cb\u521d\u59cb\u5316&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u7c7b\u52a0\u8f7d\u7684\u521d\u59cb\u5316\u9636\u6bb5\u3002\u7b2c\u4e00\u6b21\u4e3b\u52a8\u4f7f\u7528\u7c7b\u7684\u65f6\u5019\u89e6\u53d1&#xff08;new\u3001\u9759\u6001\u65b9\u6cd5\/\u9759\u6001\u53d8\u91cf\u8bbf\u95ee\u3001\u53cd\u5c04\u7b49&#xff09;\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">38. \u4ec0\u4e48\u662f\u5bf9\u8c61\u9501&#xff0c;\u4ec0\u4e48\u662f\u7c7b\u9501&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u5bf9\u8c61\u9501&#xff1a;\u9501\u7ed1\u5b9a\u5b9e\u4f8b\u5bf9\u8c61&#xff0c;synchronized\u4fee\u9970\u666e\u901a\u65b9\u6cd5\u3001\u9501\u5bf9\u8c61\u3002\u591a\u4e2a\u5b9e\u4f8b\u4e92\u4e0d\u5e72\u6270\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u7c7b\u9501&#xff1a;\u9501\u7ed1\u5b9aClass\u5bf9\u8c61&#xff0c;synchronized\u9759\u6001\u65b9\u6cd5\u3001\u9501\u7c7b.class\u3002\u5168\u5c40\u4e00\u628a\u9501\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">39. \u8fdb\u7a0b\u548c\u7ebf\u7a0b\u7684\u533a\u522b\u662f\u4ec0\u4e48&#xff1f;\u8fdb\u7a0b\u95f4\u7684\u901a\u4fe1\u65b9\u5f0f\u6709\u54ea\u4e9b&#xff1f;\u7ebf\u7a0b\u95f4\u7684\u901a\u4fe1\u65b9\u5f0f\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u8fdb\u7a0b&#xff1a;\u8d44\u6e90\u5206\u914d\u6700\u5c0f\u5355\u4f4d&#xff0c;\u72ec\u7acb\u5185\u5b58\u7a7a\u95f4&#xff1b;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u7ebf\u7a0b&#xff1a;CPU\u8c03\u5ea6\u6700\u5c0f\u5355\u4f4d&#xff0c;\u5171\u4eab\u8fdb\u7a0b\u5185\u5b58\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u8fdb\u7a0b\u901a\u4fe1&#xff1a;\u7ba1\u9053\u3001socket\u3001\u6d88\u606f\u961f\u5217\u3001\u5171\u4eab\u5185\u5b58\u3001\u4fe1\u53f7\u91cf\u3002 \u7ebf\u7a0b\u901a\u4fe1&#xff1a;wait\/notify\u3001\u5171\u4eab\u53d8\u91cf\u3001Lock\u3001CountDownLatch\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">40. \u7c7b\u9501\u548c\u5bf9\u8c61\u9501\u662f\u5426\u662f\u4e92\u65a5\u7684&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4e0d\u4e92\u65a5\u3002\u7c7b\u9501\u9501\u7684\u662fClass\u5bf9\u8c61&#xff1b;\u5bf9\u8c61\u9501\u9501\u5b9e\u4f8b\u5bf9\u8c61\u3002\u4e24\u4e2a\u9501\u5bf9\u8c61\u4e0d\u4e00\u6837&#xff0c;\u53ef\u4ee5\u540c\u65f6\u6267\u884c\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">41. \u4ec0\u4e48\u662f\u6ce8\u89e3&#xff0c;\u6ce8\u89e3\u53ef\u4ee5\u4f5c\u7528\u7c7b\u7684\u54ea\u4e9b\u90e8\u5206&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u6ce8\u89e3\u662f\u5143\u6570\u636e&#xff0c;\u7ed9\u7a0b\u5e8f\u9644\u52a0\u8bf4\u660e\u4fe1\u606f&#xff0c;\u4e0d\u76f4\u63a5\u6267\u884c\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u53ef\u4f5c\u7528&#xff1a;\u7c7b\u3001\u63a5\u53e3\u3001\u65b9\u6cd5\u3001\u6210\u5458\u53d8\u91cf\u3001\u53c2\u6570\u3001\u5c40\u90e8\u53d8\u91cf\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">42. \u5185\u90e8\u7c7b\u6709\u54ea\u51e0\u79cd&#xff1f;\u5206\u522b\u9002\u7528\u4e8e\u90a3\u4e9b\u573a\u666f&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">4\u79cd&#xff1a;\u6210\u5458\u5185\u90e8\u7c7b\u3001\u9759\u6001\u5185\u90e8\u7c7b\u3001\u5c40\u90e8\u5185\u90e8\u7c7b\u3001\u533f\u540d\u5185\u90e8\u7c7b\u3002<\/p>\n<ul>\n<li>\u6210\u5458\u5185\u90e8\u7c7b&#xff1a;\u8bbf\u95ee\u5916\u90e8\u7c7b\u6210\u5458&#xff1b;<\/li>\n<li>\u9759\u6001\u5185\u90e8\u7c7b&#xff1a;\u4e0d\u9700\u8981\u5916\u90e8\u5b9e\u4f8b&#xff0c;\u5de5\u5177\u7c7b&#xff1b;<\/li>\n<li>\u5c40\u90e8\u5185\u90e8\u7c7b&#xff1a;\u65b9\u6cd5\u5185\u4e34\u65f6\u4f7f\u7528&#xff1b;<\/li>\n<li>\u533f\u540d\u5185\u90e8\u7c7b&#xff1a;\u5feb\u901f\u5b9e\u73b0\u63a5\u53e3\/\u62bd\u8c61\u7c7b&#xff08;\u56de\u8c03\u3001\u7ebf\u7a0b&#xff09;\u3002<\/li>\n<\/ul>\n<h4 style=\"margin-left:0px;margin-right:0px\">43. finally\u7684\u4f5c\u7528&#xff0c;\u4e00\u822c\u7528\u4e8e\u4ec0\u4e48\u573a\u666f&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">finally\u4ee3\u7801\u5757\u4e00\u5b9a\u6267\u884c&#xff08;\u9664JVM\u9000\u51fa&#xff09;&#xff0c;\u7528\u4e8e\u8d44\u6e90\u91ca\u653e&#xff1a;\u5173\u95ed\u6d41\u3001\u6570\u636e\u5e93\u8fde\u63a5\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">44. \u4ec0\u4e48\u662f\u6808\u6ea2\u51fa&#xff1f;\u4ec0\u4e48\u662f\u5806\u6ea2\u51fa&#xff1f;\u4ec0\u4e48\u662f\u5806\u5916\u5185\u5b58&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u6808\u6ea2\u51faStackOverflowError&#xff1a;\u65b9\u6cd5\u8c03\u7528\u6df1\u5ea6\u8fc7\u5927&#xff0c;\u6808\u5e27\u8d85\u8fc7\u6808\u5bb9\u91cf&#xff08;\u9012\u5f52\u592a\u6df1&#xff09;\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5806\u6ea2\u51faOOM&#xff1a;\u5806\u5185\u5b58\u4e0d\u8db3\u4ee5\u521b\u5efa\u65b0\u5bf9\u8c61\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5806\u5916\u5185\u5b58&#xff1a;\u4e0d\u5728JVM\u5806\u5185&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u76f4\u63a5\u5206\u914d\u7684\u5185\u5b58&#xff0c;NIO\u7684DirectBuffer\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">45. Java\u7684\u96c6\u5408\u7c7b\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">Collection&#xff1a;List(ArrayList\u3001LinkedList\u3001Vector)&#xff1b;Set(HashSet\u3001TreeSet) Map&#xff1a;HashMap\u3001TreeMap\u3001HashTable\u3001ConcurrentHashMap<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">46. \u4ec0\u4e48\u662f\u6cdb\u578b&#xff0c;\u8bf7\u5199\u4e00\u4e2a\u6cdb\u578b\u961f\u5217\u6216\u8005\u6cdb\u578b\u6808\u3002<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u6cdb\u578b&#xff1a;\u53c2\u6570\u5316\u7c7b\u578b&#xff0c;\u7f16\u8bd1\u671f\u7c7b\u578b\u68c0\u67e5&#xff0c;\u907f\u514d\u7c7b\u578b\u5f3a\u8f6c\u3002 \u6cdb\u578b\u6808\u793a\u4f8b&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">class Stack&lt;T&gt;{<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 private Object[] arr &#061; new Object[10];<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 private int index &#061; 0;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 public void push(T t){arr[index&#043;&#043;]&#061;t;}<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 public T pop(){return (T)arr[&#8211;index];}<\/p>\n<p style=\"margin-left:0;margin-right:0\">}<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">47. \u53cd\u5c04\u80fd\u5426\u83b7\u53d6\u79c1\u6709\u4fe1\u606f&#xff0c;\u5982\u679c\u80fd&#xff0c;\u9700\u8981\u6ce8\u610f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u53ef\u4ee5\u3002setAccessible(true)\u5f00\u542f\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u6ce8\u610f&#xff1a;\u4f1a\u7834\u574f\u5c01\u88c5&#xff1b;\u6709\u5b89\u5168\u7ba1\u7406\u5668\u9650\u5236&#xff1b;\u6027\u80fd\u7565\u4f4e\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">48. \u7ebf\u7a0b\u7684\u72b6\u6001\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">NEW\u65b0\u5efa\u3001RUNNABLE\u53ef\u8fd0\u884c\u3001BLOCKED\u963b\u585e\u3001WAITING\u7b49\u5f85\u3001TIMED_WAITING\u8ba1\u65f6\u7b49\u5f85\u3001TERMINATED\u7ec8\u6b62\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">49. \u7ebf\u7a0b.start()\u662f\u8fdb\u5165\u4ec0\u4e48\u72b6\u6001&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u8c03\u7528start()&#xff0c;\u7ebf\u7a0b\u8fdb\u5165RUNNABLE&#xff08;\u53ef\u8fd0\u884c&#xff09;&#xff0c;\u7b49\u5f85CPU\u8c03\u5ea6&#xff0c;\u4e0d\u662f\u76f4\u63a5\u8fd0\u884c\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">50. \u7b49\u5f85\u961f\u5217\u548c\u963b\u585e\u961f\u5217\u7684\u533a\u522b\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u7b49\u5f85\u961f\u5217&#xff1a;synchronized\u7684\u76d1\u89c6\u5668\u7b49\u5f85\u96c6\u5408&#xff0c;wait\u8fdb\u5165&#xff0c;notify\u5524\u9192\u3002 \u963b\u585e\u961f\u5217&#xff08;BlockingQueue&#xff09;&#xff1a;\u5e76\u53d1\u5bb9\u5668&#xff0c;take()\/put()\u81ea\u5e26\u963b\u585e&#xff0c;\u751f\u4ea7\u8005\u6d88\u8d39\u8005\u6a21\u578b&#xff0c;\u5e95\u5c42\u5c01\u88c5\u9501&#043;\u7b49\u5f85\u961f\u5217\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">51. sleep()\u548cwait()\u7684\u533a\u522b\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<li>sleep\u662fThread\u9759\u6001\u65b9\u6cd5&#xff1b;wait\u662fObject\u65b9\u6cd5\u3002<\/li>\n<li>sleep\u4e0d\u91ca\u653e\u9501&#xff1b;wait\u91ca\u653e\u9501\u3002<\/li>\n<li>sleep\u65f6\u95f4\u5230\u81ea\u52a8\u6062\u590d&#xff1b;wait\u9700\u8981notify\u5524\u9192\u3002<\/li>\n<li>sleep\u4e0d\u4e00\u5b9a\u8981\u5728\u540c\u6b65\u5757&#xff1b;wait\u5fc5\u987b\u5728synchronized\u5185\u3002<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">52. sleep(1)\u4ec0\u4e48\u4f5c\u7528&#xff0c;\u90fd\u7528\u4e8e\u54ea\u4e9b\u573a\u666f&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4f5c\u7528&#xff1a;\u8ba9\u51faCPU&#xff0c;\u8fdb\u5165TIMED_WAITING&#xff0c;\u81f3\u5c11\u6682\u505c1ms\u3002 \u573a\u666f&#xff1a;\u7b80\u5355\u9650\u6d41\u3001\u8ba9\u51faCPU\u7ed9\u5176\u4ed6\u7ebf\u7a0b\u3001\u7b80\u5355\u8f6e\u8be2\u964d\u9891\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">53. \u4ec0\u4e48\u662f\u4e2d\u65ad\u673a\u5236&#xff1f;\u4e3e\u4e00\u4e2a\u4e2d\u65ad\u54cd\u5e94\u7684\u4f8b\u5b50\u3002<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u4e2d\u65ad\u662f\u7ebf\u7a0b\u7684\u6807\u8bb0&#xff0c;\u4e0d\u662f\u76f4\u63a5\u7ec8\u6b62\u7ebf\u7a0b\u3002interrupt()\u8bbe\u7f6e\u4e2d\u65ad\u6807\u8bb0&#xff0c;\u7ebf\u7a0b\u68c0\u6d4b\u6807\u8bb0\u81ea\u884c\u505c\u6b62\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">while(!Thread.currentThread().isInterrupted()){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 \/\/\u4e1a\u52a1<\/p>\n<p style=\"margin-left:0;margin-right:0\">}<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">54. \u5b88\u62a4\u7ebf\u7a0b\u662f\u4ec0\u4e48&#xff1f;\u4ec0\u4e48\u662f\u534f\u7a0b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u5b88\u62a4\u7ebf\u7a0b&#xff1a;\u540e\u53f0\u670d\u52a1\u7ebf\u7a0b&#xff0c;\u7528\u6237\u7ebf\u7a0b\u5168\u90e8\u7ed3\u675f&#xff0c;\u5b88\u62a4\u7ebf\u7a0b\u81ea\u52a8\u9000\u51fa&#xff08;GC\u7ebf\u7a0b&#xff09;\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u534f\u7a0b&#xff1a;\u7528\u6237\u6001\u8f7b\u91cf\u7ea7\u7ebf\u7a0b&#xff0c;\u7531\u7a0b\u5e8f\u8c03\u5ea6&#xff0c;\u5360\u7528\u8d44\u6e90\u8fdc\u5c0f\u4e8e\u7ebf\u7a0b\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">55. \u5f62\u6210\u6b7b\u9501\u7684\u6761\u4ef6\u662f\u4ec0\u4e48&#xff1f;\u5982\u4f55\u907f\u514d\u6b7b\u9501&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">4\u6761\u4ef6&#xff1a;\u4e92\u65a5\u3001\u6301\u6709\u5e76\u7b49\u5f85\u3001\u4e0d\u53ef\u5265\u593a\u3001\u5faa\u73af\u7b49\u5f85\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u907f\u514d&#xff1a;\u7edf\u4e00\u9501\u83b7\u53d6\u987a\u5e8f\u3001\u8bbe\u7f6e\u8d85\u65f6\u3001\u7834\u574f\u6301\u6709\u7b49\u5f85\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">56. \u57fa\u672c\u7c7b\u578b\u7684\u6570\u636e\u5b58\u5728jvm\u7684\u54ea\u4e2a\u533a\u57df&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u5c40\u90e8\u53d8\u91cf\u91cc\u7684\u57fa\u672c\u7c7b\u578b&#xff1a;\u865a\u62df\u673a\u6808&#xff1b;\u4f5c\u4e3a\u5bf9\u8c61\u6210\u5458\u53d8\u91cf\u7684\u57fa\u672c\u7c7b\u578b&#xff0c;\u5728\u5806\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">57. \u591a\u7ebf\u7a0b\u7684\u4f7f\u7528\u573a\u666f\u6709\u54ea\u4e9b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">IO\u5bc6\u96c6\u578b\u4efb\u52a1&#xff1a;\u7f51\u7edc\u8bf7\u6c42\u3001\u6587\u4ef6\u8bfb\u5199&#xff1b;\u540e\u53f0\u5f02\u6b65\u4efb\u52a1&#xff1b;\u5e76\u884c\u8ba1\u7b97&#xff1b;\u6d88\u606f\u6d88\u8d39\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">58. Throw\u548cThrows\u7684\u533a\u522b&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">throws\u5199\u5728\u65b9\u6cd5\u58f0\u660e&#xff0c;\u58f0\u660e\u672c\u65b9\u6cd5\u53ef\u80fd\u629b\u51fa\u5f02\u5e38&#xff1b;<\/p>\n<p style=\"margin-left:0;margin-right:0\">throw\u5199\u5728\u65b9\u6cd5\u4f53\u5185&#xff0c;\u624b\u52a8\u629b\u51fa\u4e00\u4e2a\u5f02\u5e38\u5b9e\u4f8b\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">59. Object\u7c7b\u7684\u65b9\u6cd5\u6709\u54ea\u4e9b&#xff1f;\u5206\u522b\u6709\u4ec0\u4e48\u4f5c\u7528&#xff1f;<\/h4>\n<li>equals()&#xff1a;\u5bf9\u8c61\u76f8\u7b49\u6bd4\u8f83<\/li>\n<li>hashCode()&#xff1a;\u8fd4\u56de\u54c8\u5e0c\u7801<\/li>\n<li>getClass()&#xff1a;\u83b7\u53d6\u8fd0\u884c\u65f6Class<\/li>\n<li>wait()&#xff1a;\u76d1\u89c6\u5668\u7b49\u5f85<\/li>\n<li>notify()\/notifyAll()&#xff1a;\u5524\u9192\u7b49\u5f85\u7ebf\u7a0b<\/li>\n<li>clone()&#xff1a;\u5bf9\u8c61\u62f7\u8d1d<\/li>\n<li>finalize()&#xff1a;\u5783\u573e\u56de\u6536\u524d\u6267\u884c&#xff08;\u5e9f\u5f03&#xff09;<\/li>\n<li>toString()&#xff1a;\u5bf9\u8c61\u5b57\u7b26\u4e32\u63cf\u8ff0<\/li>\n<h4 style=\"margin-left:0px;margin-right:0px\">60. \u603b\u7ebf\u9501\u7684\u4f18\u7f3a\u70b9\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u603b\u7ebf\u9501&#xff1a;CPU\u9501\u4f4f\u603b\u7ebf&#xff0c;\u540c\u4e00\u65f6\u523b\u53ea\u6709\u4e00\u4e2aCPU\u8bbf\u95ee\u5185\u5b58\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u4f18\u70b9&#xff1a;\u7b80\u5355&#xff0c;\u4fdd\u8bc1\u539f\u5b50\u6027&#xff1b;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u7f3a\u70b9&#xff1a;\u9501\u6574\u4e2a\u603b\u7ebf&#xff0c;\u591a\u6838CPU\u5e76\u53d1\u6027\u80fd\u5dee\u3002\u540e\u6765\u4f18\u5316\u4e3a\u7f13\u5b58\u9501&#xff08;MESI&#xff09;\u3002<\/p>\n<hr \/>\n<h3 style=\"margin-left:0px;margin-right:0px\">\u4ee3\u7801\u9898&#xff08;\u6bcf\u989810\u5206&#xff09;<\/h3>\n<h4 style=\"margin-left:0px;margin-right:0px\">1. \u5199\u4e09\u4e2a\u7ebf\u7a0bt1\u3001t2\u3001t3&#xff0c;t1\u8f93\u51faA&#xff0c;t2\u8f93\u51faB&#xff0c;t3\u8f93\u51faC&#xff0c;\u5faa\u73af\u8f93\u51fa ABABC<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u601d\u8def&#xff1a;\u7528\u9501&#043;\u72b6\u6001\u6807\u8bb0&#xff0c;\u63a7\u5236\u7ebf\u7a0b\u8f6e\u6d41\u6267\u884c&#xff0c;\u5faa\u73af\u987a\u5e8f A \u2192 B \u2192 A \u2192 B \u2192 C<\/p>\n<p style=\"margin-left:0;margin-right:0\">public class ABCThread {<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 static Object lock &#061; new Object();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 \/\/state:0\u8f93\u51faA&#xff0c;1\u8f93\u51faB&#xff0c;2\u8f93\u51faA&#xff0c;3\u8f93\u51faB&#xff0c;4\u8f93\u51faC&#xff0c;\u5faa\u73af<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 static int state &#061; 0;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 public static void main(String[] args) {<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thread t1 &#061; new Thread(()-&gt;{<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(true){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 synchronized (lock){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(state !&#061;0 &amp;&amp; state !&#061;2){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try {lock.wait();} catch (InterruptedException e) {}<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System.out.print(&#034;A&#034;);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0state&#043;&#043;;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lock.notifyAll();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 },&#034;t1&#034;);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thread t2 &#061; new Thread(()-&gt;{<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(true){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 synchronized (lock){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(state !&#061;1 &amp;&amp; state !&#061;3){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try {lock.wait();} catch (InterruptedException e) {}<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System.out.print(&#034;B&#034;);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 state&#043;&#043;;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(state&#061;&#061;5) state&#061;0;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lock.notifyAll();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 },&#034;t2&#034;);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Thread t3 &#061; new Thread(()-&gt;{<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(true){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 synchronized (lock){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 while(state !&#061;4){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try {lock.wait();} catch (InterruptedException e) {}<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System.out.print(&#034;C&#034;);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 state&#043;&#043;;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(state&#061;&#061;5) state&#061;0;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lock.notifyAll();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 },&#034;t3&#034;);<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0t1.start();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 t2.start();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 t3.start();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">}<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u903b\u8f91&#xff1a;state 0(A)\u21921(B)\u21922(A)\u21923(B)\u21924(C)&#xff0c;state\u91cd\u7f6e\u4e3a0&#xff0c;\u5faa\u73afABABC\u3002<\/p>\n<h4 style=\"margin-left:0px;margin-right:0px\">2. \u9ed8\u5199\u61d2\u6c49\u5f0f\u5355\u4f8b\u6a21\u5f0f&#xff0c;\u4ee5\u53ca\u4ee3\u7801\u89e3\u91ca<\/h4>\n<p style=\"margin-left:0;margin-right:0\">public class Singleton {<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 \/\/\u79c1\u6709\u9759\u6001\u53d8\u91cf&#xff0c;\u4e0d\u521d\u59cb\u5316<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 private static Singleton instance;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 \/\/\u79c1\u6709\u6784\u9020&#xff0c;\u7981\u6b62\u5916\u90e8new<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 private Singleton(){}<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 \/\/\u83b7\u53d6\u5b9e\u4f8b&#xff0c;\u7b2c\u4e00\u6b21\u8c03\u7528\u624d\u521b\u5efa<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 public static Singleton getInstance(){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(instance &#061;&#061; null){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 instance &#061; new Singleton();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return instance;<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">}<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u89e3\u91ca&#xff1a;\u61d2\u6c49\u5f0f&#xff0c;\u5ef6\u8fdf\u52a0\u8f7d&#xff0c;\u8c03\u7528getInstance\u624d\u521b\u5efa\u5bf9\u8c61\u3002\u7f3a\u70b9&#xff1a;\u591a\u7ebf\u7a0b\u73af\u5883\u7ebf\u7a0b\u4e0d\u5b89\u5168&#xff0c;\u591a\u7ebf\u7a0b\u540c\u65f6\u8fdb\u5165if\u4f1a\u521b\u5efa\u591a\u4e2a\u5b9e\u4f8b\u3002 \u3010\u53ef\u9009&#xff1a;\u7ebf\u7a0b\u5b89\u5168\u7248\u672c\u3011\u52a0synchronized&#xff1a;<\/p>\n<p style=\"margin-left:0;margin-right:0\">public static synchronized Singleton getInstance(){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 if(instance &#061;&#061; null){<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 instance &#061; new Singleton();<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 }<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u00a0\u00a0\u00a0 return instance;<\/p>\n<p style=\"margin-left:0;margin-right:0\">}<\/p>\n<h3 style=\"margin-left:0px;margin-right:0px\">\u63a8\u7406\u9898&#xff08;10\u5206&#xff0c;\u4e0d\u5c11\u4e8e500\u5b57&#xff09;<\/h3>\n<h4 style=\"margin-left:0px;margin-right:0px\">1.Tomcat\u5982\u4f55\u8bbf\u95ee\u5230Controller\u7684,\u5185\u90e8\u5b9e\u73b0\u539f\u7406\u662f\u4ec0\u4e48&#xff1f;<\/h4>\n<p style=\"margin-left:0;margin-right:0\">\u6d4f\u89c8\u5668\u8f93\u5165\u5730\u5740\u53d1\u8d77HTTP\u8bf7\u6c42&#xff0c;\u8bf7\u6c42\u7ecf\u8fc7\u7f51\u7edc\u5230\u8fbeTomcat&#xff0c;\u6574\u4f53\u6d41\u7a0b\u5206\u4e3a&#xff1a;\u7aef\u53e3\u63a5\u6536\u3001\u89e3\u6790\u8bf7\u6c42\u3001\u5339\u914dServlet\u3001\u8f6c\u53d1\u5230SpringMVC\u7684Controller\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">Tomcat\u5e95\u5c42\u662fSocket\u901a\u4fe1&#xff0c;\u542f\u52a8\u65f6\u57288080\u7aef\u53e3\u5f00\u542fServerSocket&#xff0c;\u6301\u7eed\u76d1\u542c\u5ba2\u6237\u7aef\u8fde\u63a5\u3002\u6d4f\u89c8\u5668\u53d1\u9001HTTP\u8bf7\u6c42\u62a5\u6587&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u628aTCP\u6570\u636e\u5305\u4ea4\u7ed9Tomcat\u3002Tomcat\u7684Connector\u7ec4\u4ef6\u8d1f\u8d23\u63a5\u6536Socket\u8fde\u63a5&#xff0c;\u8bfb\u53d6HTTP\u62a5\u6587&#xff0c;\u89e3\u6790\u8bf7\u6c42\u884c\u3001\u8bf7\u6c42\u5934&#xff0c;\u5c01\u88c5\u6210HttpServletRequest\u5bf9\u8c61&#xff1b;\u540c\u65f6\u51c6\u5907HttpServletResponse\u5bf9\u8c61&#xff0c;\u7528\u6765\u56de\u5199\u54cd\u5e94\u6570\u636e\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">Connector\u89e3\u6790\u5b8c\u6210\u540e&#xff0c;\u628a\u8bf7\u6c42\u4ea4\u7ed9Container\u5bb9\u5668\u3002Container\u5305\u542bEngine\u3001Host\u3001Context\u3001Wrapper\u56db\u5c42\u5bb9\u5668\u3002Engine\u4ee3\u8868\u6574\u4e2a\u5f15\u64ce&#xff0c;Host\u5bf9\u5e94\u865a\u62df\u4e3b\u673a&#xff0c;Context\u5bf9\u5e94\u4e00\u4e2aweb\u9879\u76ee&#xff0c;Wrapper\u5c01\u88c5Servlet\u3002Tomcat\u6839\u636e\u8bf7\u6c42url&#xff0c;\u5339\u914d\u5bf9\u5e94\u7684Context\u9879\u76ee\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">SpringMVC\u9879\u76ee\u4e2d&#xff0c;web.xml\u81ea\u52a8\u6ce8\u518cDispatcherServlet&#xff0c;\u5b83\u662f\u524d\u7aef\u63a7\u5236\u5668&#xff0c;\u672c\u8d28\u662f\u4e00\u4e2aServlet\u3002\u5f53\u8bf7\u6c42\u8fdb\u5165Context\u540e&#xff0c;\u5339\u914d\u5230DispatcherServlet&#xff0c;\u8fdb\u5165\u5b83\u7684service\u65b9\u6cd5\u3002DispatcherServlet\u662f\u6574\u4e2aMVC\u7684\u5165\u53e3\u3002DispatcherServlet\u5185\u90e8\u8c03\u7528doDispatch\u6838\u5fc3\u65b9\u6cd5\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">doDispatch\u5185\u90e8\u6d41\u7a0b&#xff1a;\u9996\u5148\u901a\u8fc7HandlerMapping&#xff0c;\u6839\u636e\u8bf7\u6c42URL\u67e5\u627e\u5bf9\u5e94\u7684Controller\u5904\u7406\u5668\u3002HandlerMapping\u4fdd\u5b58URL\u548cController\u65b9\u6cd5\u7684\u6620\u5c04\u5173\u7cfb&#xff0c;\u626b\u63cf\u9879\u76ee\u6240\u6709&#064;Controller\u6ce8\u89e3&#xff0c;\u628a&#064;RequestMapping\u5730\u5740\u548c\u65b9\u6cd5\u7ed1\u5b9a\u3002\u627e\u5230Handler\u4e4b\u540e&#xff0c;\u83b7\u53d6\u5bf9\u5e94\u7684HandlerAdapter&#xff0c;HandlerAdapter\u8d1f\u8d23\u8c03\u7528Controller\u65b9\u6cd5\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">HandlerAdapter\u901a\u8fc7\u53cd\u5c04\u6267\u884cController\u91cc\u7684\u76ee\u6807\u65b9\u6cd5&#xff0c;\u4f20\u5165\u8bf7\u6c42\u53c2\u6570\u3002Controller\u6267\u884c\u4e1a\u52a1\u903b\u8f91&#xff0c;\u8fd4\u56deModelAndView\u6216\u8005\u76f4\u63a5\u8fd4\u56deJSON\u3002 \u5982\u679c\u8fd4\u56de\u89c6\u56fe&#xff0c;DispatcherServlet\u8c03\u7528ViewResolver\u89c6\u56fe\u89e3\u6790\u5668&#xff0c;\u627e\u5230\u9875\u9762&#xff0c;\u6e32\u67d3\u6570\u636e&#xff1b;\u5982\u679c\u662f&#064;ResponseBody&#xff0c;\u76f4\u63a5\u628a\u8fd4\u56de\u5bf9\u8c61\u8f6c\u4e3aJSON&#xff0c;\u5199\u5165Response\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u5904\u7406\u5b8c\u6210\u540e&#xff0c;DispatcherServlet\u628a\u7ed3\u679c\u5199\u5165HttpServletResponse\u3002Tomcat\u7684Connector\u62ff\u5230response&#xff0c;\u7ec4\u88c5HTTP\u54cd\u5e94\u62a5\u6587&#xff0c;\u901a\u8fc7Socket\u5199\u56de\u6d4f\u89c8\u5668\u3002\u8bf7\u6c42\u94fe\u8def\u7ed3\u675f&#xff0c;\u5173\u95ed\u8fde\u63a5&#xff08;HTTP1.1\u957f\u8fde\u63a5\u5219\u590d\u7528\u8fde\u63a5&#xff09;\u3002<\/p>\n<p style=\"margin-left:0;margin-right:0\">\u603b\u7ed3&#xff1a;Tomcat\u8d1f\u8d23\u5e95\u5c42\u7f51\u7edc\u901a\u4fe1\u3001HTTP\u62a5\u6587\u89e3\u6790&#xff0c;\u628a\u8bf7\u6c42\u4ea4\u7ed9Servlet&#xff1b;SpringMVC\u7684DispatcherServlet\u4f5c\u4e3a\u6838\u5fc3Servlet&#xff0c;\u5b8c\u6210URL\u8def\u7531&#xff0c;\u8c03\u7528Controller&#xff0c;\u5904\u7406\u8fd4\u56de\u7ed3\u679c\u3002Tomcat\u63d0\u4f9bWeb\u8fd0\u884c\u73af\u5883&#xff0c;SpringMVC\u5728Servlet\u4e4b\u4e0a\u505a\u8def\u7531\u548c\u4e1a\u52a1\u5206\u53d1&#xff0c;\u4e8c\u8005\u914d\u5408\u5b8c\u6210\u4ece\u6d4f\u89c8\u5668\u8bbf\u95ee\u5230Controller\u6267\u884c\u7684\u5b8c\u6574\u6d41\u7a0b\u3002<\/p>\n<hr \/>\n<p style=\"margin-left:0;margin-right:0\">\n","protected":false},"excerpt":{"rendered":"<p>JAVA \u590d\u4e60\u9898\u7b80\u5355\u98981. \u8ba1\u7b97\u673a\u7f51\u7edc\u4f20\u8f93\u5c42\u6709\u54ea\u4e9b\u534f\u8bae&#xff1f;\u5206\u522b\u9002\u7528\u4e8e\u4ec0\u4e48\u573a\u666f&#xff1f;\u4f20\u8f93\u5c42\u6838\u5fc3\u534f\u8bae&#xff1a;TCP\u3001UDPTCP&#xff1a;\u9762\u5411\u8fde\u63a5\u3001\u53ef\u9760\u4f20\u8f93\u3002\u9002\u7528&#xff1a;\u6587\u4ef6\u4f20\u8f93\u3001\u7f51\u9875\u8bbf\u95ee\u3001\u6570\u636e\u5e93\u8fde\u63a5&#xff08;\u9700\u8981\u6570\u636e\u4e0d\u4e22\u5931\u3001\u987a\u5e8f\u6b63\u786e&#xff09;\u3002UDP&#xff1a;\u65e0\u8fde\u63a5\u3001\u4e0d\u53ef\u9760&#xff0c;\u5f00\u9500\u5c0f\u3002\u9002\u7528&#xff1a;\u76f4\u64ad\u3001\u89c6\u9891\u901a\u8bdd\u3001DNS\u67e5\u8be2\u3001\u6e38\u620f&#xff08;\u5141\u8bb8\u5c11\u91cf\u4e22\u5305&#xff0c;\u4f18\u5148\u901f\u5ea6&#xff09;\u3002<\/p>\n","protected":false},"author":2,"featured_media":115332,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,2630],"topic":[],"class_list":["post-115335","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-2630"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>java\u9762\u8bd5\u9898 - \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\/115335.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"java\u9762\u8bd5\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"JAVA \u590d\u4e60\u9898\u7b80\u5355\u98981. \u8ba1\u7b97\u673a\u7f51\u7edc\u4f20\u8f93\u5c42\u6709\u54ea\u4e9b\u534f\u8bae&#xff1f;\u5206\u522b\u9002\u7528\u4e8e\u4ec0\u4e48\u573a\u666f&#xff1f;\u4f20\u8f93\u5c42\u6838\u5fc3\u534f\u8bae&#xff1a;TCP\u3001UDPTCP&#xff1a;\u9762\u5411\u8fde\u63a5\u3001\u53ef\u9760\u4f20\u8f93\u3002\u9002\u7528&#xff1a;\u6587\u4ef6\u4f20\u8f93\u3001\u7f51\u9875\u8bbf\u95ee\u3001\u6570\u636e\u5e93\u8fde\u63a5&#xff08;\u9700\u8981\u6570\u636e\u4e0d\u4e22\u5931\u3001\u987a\u5e8f\u6b63\u786e&#xff09;\u3002UDP&#xff1a;\u65e0\u8fde\u63a5\u3001\u4e0d\u53ef\u9760&#xff0c;\u5f00\u9500\u5c0f\u3002\u9002\u7528&#xff1a;\u76f4\u64ad\u3001\u89c6\u9891\u901a\u8bdd\u3001DNS\u67e5\u8be2\u3001\u6e38\u620f&#xff08;\u5141\u8bb8\u5c11\u91cf\u4e22\u5305&#xff0c;\u4f18\u5148\u901f\u5ea6&#xff09;\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/115335.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-11T15:09:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261011150859-6acba68bbccdd.jpg\" \/>\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=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115335.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/115335.html\",\"name\":\"java\u9762\u8bd5\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-11T15:09:01+00:00\",\"dateModified\":\"2026-10-11T15:09:01+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/115335.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/115335.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115335.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"java\u9762\u8bd5\u9898\"}]},{\"@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":"java\u9762\u8bd5\u9898 - \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\/115335.html","og_locale":"zh_CN","og_type":"article","og_title":"java\u9762\u8bd5\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"JAVA \u590d\u4e60\u9898\u7b80\u5355\u98981. \u8ba1\u7b97\u673a\u7f51\u7edc\u4f20\u8f93\u5c42\u6709\u54ea\u4e9b\u534f\u8bae&#xff1f;\u5206\u522b\u9002\u7528\u4e8e\u4ec0\u4e48\u573a\u666f&#xff1f;\u4f20\u8f93\u5c42\u6838\u5fc3\u534f\u8bae&#xff1a;TCP\u3001UDPTCP&#xff1a;\u9762\u5411\u8fde\u63a5\u3001\u53ef\u9760\u4f20\u8f93\u3002\u9002\u7528&#xff1a;\u6587\u4ef6\u4f20\u8f93\u3001\u7f51\u9875\u8bbf\u95ee\u3001\u6570\u636e\u5e93\u8fde\u63a5&#xff08;\u9700\u8981\u6570\u636e\u4e0d\u4e22\u5931\u3001\u987a\u5e8f\u6b63\u786e&#xff09;\u3002UDP&#xff1a;\u65e0\u8fde\u63a5\u3001\u4e0d\u53ef\u9760&#xff0c;\u5f00\u9500\u5c0f\u3002\u9002\u7528&#xff1a;\u76f4\u64ad\u3001\u89c6\u9891\u901a\u8bdd\u3001DNS\u67e5\u8be2\u3001\u6e38\u620f&#xff08;\u5141\u8bb8\u5c11\u91cf\u4e22\u5305&#xff0c;\u4f18\u5148\u901f\u5ea6&#xff09;\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/115335.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-11T15:09:01+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261011150859-6acba68bbccdd.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/115335.html","url":"https:\/\/www.wsisp.com\/helps\/115335.html","name":"java\u9762\u8bd5\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-11T15:09:01+00:00","dateModified":"2026-10-11T15:09:01+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/115335.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/115335.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/115335.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"java\u9762\u8bd5\u9898"}]},{"@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\/115335","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=115335"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115335\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/115332"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=115335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=115335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=115335"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=115335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}