{"id":1377,"date":"2023-06-27T13:54:39","date_gmt":"2023-06-27T05:54:39","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1377"},"modified":"2023-06-27T13:54:39","modified_gmt":"2023-06-27T05:54:39","slug":"%e9%80%81%e7%bb%99go%e5%bc%80%e5%8f%91%e8%80%85%e7%9a%84java%e5%9f%ba%e7%a1%80%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/java\/%e9%80%81%e7%bb%99go%e5%bc%80%e5%8f%91%e8%80%85%e7%9a%84java%e5%9f%ba%e7%a1%80%e6%95%99%e7%a8%8b\/","title":{"rendered":"\u9001\u7ed9Go\u5f00\u53d1\u8005\u7684Java\u57fa\u7840\u6559\u7a0b"},"content":{"rendered":"<div class='wxsyncmain'>\n<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"font-size: 16px;white-space: normal;color: black;padding-right: 10px;padding-left: 10px;word-break: break-word;word-wrap: break-word;text-align: left;line-height: 1.25;font-family: Optima-Regular, Optima, PingFangTC-Light, PingFangSC-light, PingFangTC-light;letter-spacing: 2px;background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 3%, rgba(0, 0, 0, 0) 3%);background-size: 20px 20px;background-position: center center;\"><br  \/><\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u524d\u8a00<\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u672c\u7ae0\u8282\u4e3b\u8981\u8bb2\u8ff0java\u7684\u4e00\u4e9b\u57fa\u7840\u8bed\u6cd5\uff0c\u6bd4\u5982\u5e38\u89c1\u7684\u6570\u636e\u7c7b\u578b\uff0c\u6d41\u7a0b\u63a7\u5236\u8bed\u53e5\uff0c\u7c7b\u7684\u4e00\u4e9b\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u5e2e\u52a9\u5927\u5bb6\u7406\u89e3\u548c\u5feb\u901f\u5165\u95e8\u3002\u5982\u679c\u4f60\u5df2\u7ecf\u5bf9jav\u5f88\u719f\u6089\u4e86\uff0c\u53ef\u4ee5\u8df3\u8fc7\u672c\u7ae0\u8282\u7684\u5185\u5bb9\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">java\u7b80\u5355\u4ecb\u7ecd<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">Java\u662f\u4e00\u95e8<span style=\"color:#3eaf7c;\">\u9762\u5411\u5bf9\u8c61<\/span>&nbsp;\u7f16\u7a0b\u8bed\u8a00, Javas\u662f\u9759\u6001\u8bed\u8a00\u3002Java\u5177\u6709\u7b80\u5355\u6027\u3001\u9762\u5411\u5bf9\u8c61\u3001\u5206\u5e03\u5f0f\u3001\u5065\u58ee\u6027\u3001\u5b89\u5168\u6027\u3001\u5e73\u53f0\u72ec\u7acb\u4e0e\u53ef\u79fb\u690d\u6027\u3001\u591a\u7ebf\u7a0b\u3001\u52a8\u6001\u6027\u7b49\u7279\u70b9\u3002Java\u53ef\u4ee5\u7f16\u5199\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3001Web\u5e94\u7528\u7a0b\u5e8f\u3001\u5206\u5e03\u5f0f\u7cfb\u7edf\u548c\u5d4c\u5165\u5f0f\u7cfb\u7edf\u5e94\u7528\u7a0b\u5e8f\u7b49\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fd9\u91cc\u7b80\u5355\u8bf4\u4e00\u4e0b\u4ec0\u4e48\u662f\u9759\u6001\u8bed\u8a00\uff0c\u4ec0\u4e48\u662f\u52a8\u6001\u8bed\u8a00\uff1f<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u9759\u6001\u8bed\u8a00,\u6bd4\u5982java\u5b83\u9700\u8981\u7f16\u8bd1\u6210\u673a\u5668\u7801\uff0c\u624d\u80fd\u591f\u88ab\u8ba1\u7b97\u8bc6\u522b\u53ef\u8fd0\u884c\uff0c\u56e0\u4e3a\u8ba1\u7b97\u673a\u53ea\u80fd\u770b\u61c2\u4e8c\u8fdb\u5236\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u52a8\u6001\u8bed\u8a00\uff0c\u4e0d\u9700\u8981\u6211\u4eec\u624b\u52a8\u53bb\u7f16\u8bd1\uff0c\u5b83\u53ef\u4ee5\u76f4\u63a5\u53bb\u8fd0\u884c\u6211\u4eec\u7684\u4ee3\u7801\u6587\u4ef6\uff0c\u6bd4\u8f83\u5178\u578b\u7684python,js\u8fd9\u79cd\u811a\u672c\u8bed\u8a00\u3002<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5176\u5b9e\u52a8\u6001\u8bed\u8a00\u5b83\u672c\u8eab\u5185\u7f6e\u4e86\u4e00\u4e2a\u89e3\u91ca\u5668\uff0c\u5b83\u901a\u8fc7\u89e3\u91ca\u5668\u53bb\u5b8c\u6210\u6211\u4eec\u7684\u7f16\u8bd1\u5de5\u4f5c\uff0c\u6240\u4ee5\u6211\u4eec\u611f\u77e5\u4e0d\u5230\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6240\u8c13\u5de5\u6b32\u5584\u5176\u4e8b\uff0c\u5fc5\u5148\u5229\u5176\u5668\uff0c\u9009\u62e9\u597d\u7684\u5f00\u53d1\u5de5\u5177\uff0c\u80fd\u63d0\u5347\u6211\u4eec\u7684\u5f00\u53d1\u4f53\u9a8c\u3002\u5efa\u8bae\u5927\u5bb6\u4f7f\u7528 jetbrains\u7684&nbsp;<span style=\"color:#3eaf7c;\">idea<\/span>&nbsp;\u5f00\u53d1\u5de5\u5177\u6765\u5f00\u53d1java\u5e94\u7528, \u76ee\u524d\u5927\u90e8\u5206\u5f00\u53d1\u8005\u90fd\u4f1a\u9009\u62e9\u4f7f\u7528\u5b83\uff0c\u975e\u5e38\u7684\u65b9\u4fbf\uff0c \u540e\u8fb9\u6211\u4f1a\u51fa\u4e00\u7bc7\u6587\u7ae0\u4e13\u95e8\u6765\u8bb2\u4e00\u4e0b\uff0c\u5982\u4f55\u914d\u7f6e\u6211\u4eec\u7684idea\u5de5\u5177\uff0c\u4f7f\u5f97\u5b83\u66f4\u52a0\u5f3a\u5927\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u4e0b\u8f7didea<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fdb\u5165\u5b98\u7f51\u540e\uff0c\u76f4\u63a5\u70b9\u51fb&nbsp;<span style=\"color:#3eaf7c;\">download<\/span>&nbsp;\u8fdb\u884c\u4e0b\u8f7d,\u6d4f\u89c8\u5668\u4f1a\u81ea\u52a8\u5224\u65ad\u4f60\u7684\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\uff0c\u9009\u62e9&nbsp;<span style=\"color:#3eaf7c;\">Ultimate\u7248\u672c<\/span>,\u53e6\u4e00\u4e2a\u7248\u672c\u662f\u793e\u533a\u7248\uff0c\u6211\u4eec\u9009\u62e9\u4e13\u4e1a\u7248\u3002\u4e0b\u8f7d\u5b8c\u6210\u540e\u70b9\u51fb\u5b89\u88c5\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9ed8\u8ba4\u5b83\u662f\u4e00\u4e2a\u7eaf\u82f1\u6587\u7684\u754c\u9762\uff0c \u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5\u6c49\u5316\u63d2\u4ef6\uff0c\u70b9\u51fb&nbsp;<span style=\"color:#3eaf7c;\">\u8bbe\u7f6e -&gt; \u63d2\u4ef6 -&gt; \u641c\u7d22\uff08Chinese (Simplified) Language Pack \/ \u4e2d\u6587\u8bed\u8a00\u5305\uff09<\/span>&nbsp;\u8fdb\u884c\u5b89\u88c5\u5373\u53ef\uff0c \u91cd\u542f\u540e\u4f1a\u770b\u5230\u4e2d\u6587\u754c\u9762\u4e86\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u914d\u7f6eJDK<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7idea\u6765\u4e0b\u8f7djdk\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7&nbsp;<span style=\"color:#3eaf7c;\">\u5b98\u7f51<\/span>&nbsp;\u6765\u4e0b\u8f7d, \u8fd9\u91cc\u6211\u4eec\u4f7f\u7528idea\u6765\u4e0b\u8f7djdk, \u5b98\u7f51\u4e0b\u8f7d\u73b0\u5728\u597d\u50cf\u8981\u6ce8\u518c\u8d26\u53f7\u4e86\uff0c\u6709\u70b9\u5c0f\u9ebb\u70e6\u3002\u6253\u5f00idea\uff0c\u70b9\u51fb\u65b0\u5efa\u9879\u76ee, \u6211\u4eec\u9009\u62e9maven\u6765\u65b0\u5efa\u9879\u76ee, <span style=\"color:#3eaf7c;\"><code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">maven<\/code><\/span>&nbsp;\u662fjava\u7684\u4e00\u79cd\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u80fd\u591f\u5f88\u65b9\u4fbf\u7684\u5e2e\u52a9\u6211\u4eec\u6784\u5efa\u9879\u76ee\uff0c\u6211\u4eec\u5f00\u53d1\u9879\u76ee\u53ef\u80fd\u4f1a\u5f15\u7528\u4e00\u4e9b\u6210\u719f\u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u7528\u7b80\u5355\u7684\u914d\u7f6e\u5c31\u53ef\u4ee5\u628a\u5e93\u5f15\u8fdb\u6765\uff0c\u60f3\u4e86\u89e3\u66f4\u591a\uff0c\u53ef\u4ee5\u5230\u5b83\u7684&nbsp;<span style=\"color:#3eaf7c;\">\u5b98\u7f51<\/span>&nbsp;\u3002\u9009\u62e9\u597d\u4e86\u4ee5\u540e\uff0c\u8ddf\u7740\u4ee5\u4e0b\u6b65\u9aa4\u6765\u642d\u5efa\u6211\u4eec\u7684\u73af\u5883:<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u70b9\u51fb\u9879\u76eesdk\uff0c \u8fd9\u65f6\u5019\u4f1a\u53d1\u73b0\u662f\u7a7a\u7684<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u70b9\u51fb\u4e0b\u8f7djdk, \u7248\u672c\u6211\u4eec\u9009\u62e91.8, \u4f9b\u5e94\u5546\u6211\u4eec\u9009\u62e9&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">\u4e9a\u9a6c\u900a Corretto<\/code>, \u4f4d\u7f6e\u6211\u4eec\u53ef\u4ee5\u9ed8\u8ba4\u3002\u4e0b\u8f7d\u597d\u4e86\u4ee5\u540e\uff0c\u4f1a\u81ea\u52a8\u5e2e\u6211\u4eec\u9009\u62e9\u521a\u521a\u4e0b\u8f7d\u7684jdk<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u70b9\u51fb\u4e0b\u4e00\u6b65\uff0c \u9879\u76ee\u540d\u548c\u9879\u76ee\u6240\u5728\u4f4d\u7f6e\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c \u597d\u4e86\u4ee5\u540e\u70b9\u51fb\u5b8c\u6210\uff0c\u4f1a\u81ea\u52a8\u6253\u5f00\u9879\u76ee<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<h4 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">\u76ee\u5f55\u7ed3\u6784\u8bf4\u660e<\/h4>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">pom.xml<\/span>&nbsp;\u8fd9\u4e2a\u6587\u4ef6\u5b58\u5728\u4e8e\u6839\u76ee\u5f55\uff0c \u4e3b\u8981\u7528\u4e8e\u914d\u7f6emaven\u7684\u6784\u5efa\u4fe1\u606f\uff0c\u5b66\u4e60\u57fa\u7840\u90e8\u5206\uff0c\u6211\u4eec\u53ef\u4ee5\u6682\u65f6\u4e0d\u7528\u7ba1\u5b83\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">src<\/span>&nbsp;\u8fd9\u4e2a\u76ee\u5f55\u4e3b\u8981\u7528\u4e8e\u653e\u6211\u4eec\u7f16\u5199\u7684\u6e90\u7801\uff0c\u4e0b\u8fb9\u6709\u4e00\u4e2ajava \u548c resource \u7684\u76ee\u5f55\uff0cjava\u5b58\u653e\u6211\u4eec\u7684\u4ee3\u7801\uff0cresource\u4e3b\u8981\u653e\u4e00\u4e9b\u8d44\u6e90\uff0c\u6bd4\u5982\u914d\u7f6e\u6587\u4ef6\u8fd9\u4e9b\uff0c\u6682\u65f6\u53ef\u4ee5\u4e0d\u7528\u7ba1\u5b83\u3002<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e3a\u4e86\u89c4\u8303\uff0c\u8fd9\u4e9b\u76ee\u5f55\u548c\u6587\u4ef6\u4e0d\u8981\u53bb\u91cd\u547d\u540d\u6216\u8005\u5176\u5b83\u66f4\u6539\uff0c \u5982\u679c\u6539\u52a8\uff0c idea\u5df2\u7ecf\u8db3\u591f\u667a\u80fd\u63d0\u9192\u6211\u4eec\u4e0d\u8981\u4e71\u6539\u547d\u540d\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">JDK\u662f\u4ec0\u4e48\uff1f<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">jdk\uff08Java Development Kit\uff09<\/span>\uff0c\u4ece\u5b57\u9762\u610f\u601d\u7ffb\u8bd1\u8fc7\u6765\u5c31\u662fjava\u5f00\u53d1\u7684\u5de5\u5177\u3002\u6253\u4e2a\u6bd4\u55bb\uff0c\u6211\u4eec\u6253\u6e38\u620f\u4e4b\u524d\u9700\u8981\u5b89\u88c5\u4e00\u4e2a\u8f6f\u4ef6\uff0c\u7136\u540e\u6211\u4eec\u624d\u80fd\u6253\u5f00\u548c\u64cd\u4f5c\u5b83\u3002\u90a3\u4e48jdk\u4f60\u4e5f\u53ef\u4ee5\u7406\u89e3\u662f\u4e00\u4e2a\u8f6f\u4ef6\uff0c\u5b83\u7528\u6765\u5e2e\u52a9\u6211\u4eec\u7f16\u5199\u4ee3\u7801\u3002\u8fd9\u91cc\u8fd8\u597d\u5f15\u7533\u53e6\u5916\u4e24\u4e2a\u540d\u8bcd\uff0c JRE\u548cJVM\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">JRE<\/span>&nbsp;\u987e\u540d\u601d\u4e49\u662fjava\u8fd0\u884c\u65f6\u73af\u5883\uff0c\u5305\u542b\u4e86java\u865a\u62df\u673a\uff0cjava\u57fa\u7840\u7c7b\u5e93\u3002\u662f\u4f7f\u7528java\u8bed\u8a00\u7f16\u5199\u7684\u7a0b\u5e8f\u8fd0\u884c\u6240\u9700\u8981\u7684\u8f6f\u4ef6\u73af\u5883\uff0c\u662f\u63d0\u4f9b\u7ed9\u60f3\u8fd0\u884cjava\u7a0b\u5e8f\u7684\u7528\u6237\u4f7f\u7528\u7684\u3002JDK\u5305\u542b\u4e86JRE\uff0c\u540c\u65f6\u8fd8\u5305\u542b\u4e86\u7f16\u8bd1java\u6e90\u7801\u7684\u7f16\u8bd1\u5668javac\u3002JRE\u6839\u636e\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf, \u63d0\u4f9b\u4e0d\u540c\u7684\u8fd0\u884c\u65f6\u73af\u5883\uff0c\u6240\u4ee5java\u5b83\u4e5f\u662f\u8de8\u5e73\u53f0\u7684\u8bed\u8a00\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">JVM\u662fJava Virtual Machine(Java\u865a\u62df\u673a)<\/span>&nbsp;\u7684\u7f29\u5199\u3002\u5b83\u662fjava\u8fd0\u884c\u73af\u5883\u7684\u4e00\u90e8\u5206\uff0c\u662f\u4e00\u4e2a\u865a\u6784\u51fa\u6765\u7684\u8ba1\u7b97\u673a\uff0c\u5b83\u662f\u901a\u8fc7\u5728\u5b9e\u9645\u7684\u8ba1\u7b97\u673a\u4e0a\u4eff\u771f\u6a21\u62df\u5404\u79cd\u8ba1\u7b97\u673a\u529f\u80fd\u6765\u5b9e\u73b0\u7684\u3002JVM\u662f\u7528\u6765\u89e3\u6790\u548c\u8fd0\u884cJava\u7a0b\u5e8f\u7684\u3002<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">hello world<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u60f3\u8981\u8f93\u51fa\u4e00\u53e5 \u201d\u4f60\u597d\uff0c \u61a8\u61a8\u201c\uff0c \u600e\u4e48\u641e? \u8fd9\u5c31\u5b89\u6392\u3002\u9996\u5148\u5728java\u76ee\u5f55\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\uff0c\u4e00\u4e2a\u7a0b\u5e8f\u8981\u8dd1\u8d77\u6765\uff0c\u9996\u5148\u8981\u6709\u5165\u53e3\uff0c \u8fd9\u4e2a\u5165\u53e3\u5c31\u662f\u4e00\u4e2amain\u65b9\u6cd5\uff0c\u5728java\u4e2d\uff0c\u9700\u8981\u5199\u5728\u7c7b\u4e2d\uff1a<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">BaseMain<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u4f60\u597d\uff0c&nbsp;\u61a8\u61a8\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u70b9\u51fb\u7eff\u8272\u7684\u7bad\u5934\u5c31\u53ef\u4ee5\u8fd0\u884c\u4e86\uff0c\u56e0\u4e3aidea\u5df2\u7ecf\u5e2e\u6211\u4eec\u628a\u73af\u5883\u57fa\u7840\u8d77\u6765\u4e86\uff0c\u6240\u4ee5\u76f4\u63a5run<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e3a\u4e86\u540e\u7eed\u65b9\u4fbf\u8c03\u8bd5\uff0c\u6211\u4eec\u5e38\u4f1a\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u4fe1\u606f\uff0c\u6240\u4ee5\u5728\u65b0\u5efa\u4e00\u4e2aLog\u7c7b\uff1a<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Log<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">info<\/span><span style=\"line-height: 26px;\">(Object&nbsp;s)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(s);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u7136\u540e\u4fee\u6539\u6211\u4eec\u7684main\u65b9\u6cd5, static\u4fee\u9970\u7684\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5 \u7c7b\u540d + \u65b9\u6cd5\u540d\u53bb\u8c03\u7528:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">BaseMain<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u4f60\u597d\uff0c&nbsp;\u61a8\u61a8\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u597d\u4e86,\u4f60\u5b66\u5e9f\u4e86\u5417\uff1f<img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.918\"  data-type=\"jpeg\" data-w=\"1000\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042436299.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.918\"  data-type=\"jpeg\" data-w=\"1000\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042436299.jpeg\"  \/><\/noscript><\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u57fa\u672c\u6570\u636e\u7c7b\u578b<\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6570\u636e\u7c7b\u578b\uff0c\u987e\u540d\u601d\u4e49\u5c31\u662f\u6570\u636e\u7684\u7c7b\u578b\uff0c\u4ec0\u4e48\u662f\u6570\u636e\uff1f\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u4f60\u5728\u4f7f\u7528\u7f51\u7ad9\u65f6\uff0c\u5bc6\u5bc6\u9ebb\u9ebb\u7684\u6587\u5b57\u548c\u56fe\u7247\u5c31\u662f\u6570\u636e\uff0c\u800c\u4ed6\u4eec\u7684\u8f7d\u4f53\uff0c\u6bd4\u5982\u6587\u5b57\u5b83\u5c31\u662f\u5b57\u7b26\u7c7b\u578b\uff0c\u6211\u4eec\u901a\u5e38\u53eb\u5b83\u4e3a\u5b57\u7b26\u4e32\uff0c\u6211\u4eec\u770b\u5230\u7684\u89c6\u9891\uff0c\u56fe\u7247\u8fd9\u79cd\u4e8c\u8fdb\u5236\u6570\u636e\uff0c\u901a\u5e38\u662fbyte\u7c7b\u578b\u3002\u6211\u4eec\u901a\u8fc7\u5404\u79cd\u7c7b\u578b\u7684\u6570\u636e\u5728\u4e00\u8d77\u8ba1\u7b97\u4ea4\u4e92\uff0c\u6700\u7ec8\u5b9e\u73b0\u6211\u4eec\u7684\u7a0b\u5e8f\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">java\u6709&nbsp;<span style=\"color:#3eaf7c;\">8<\/span>&nbsp;\u79cd\u6570\u636e\u7c7b\u578b,\u5206\u522b\u662f:<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">boolean (1\/8\u4e2a\u5b57\u82821\u4f4d)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">char (2\u4e2a\u5b57\u828216\u4f4d)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">byte (1\u4e2a\u5b57\u82828\u4f4d)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">short (2\u4e2a\u5b57\u828216\u4f4d)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">int (4\u4e2a\u5b57\u828232\u4f4d)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">long (8\u4e2a\u5b57\u828264\u4f4d)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">float (4\u4e2a\u5b57\u828232\u4f4d)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">double (8\u4e2a\u5b57\u828264\u4f4d)<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">float \u4e0e double:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;float&nbsp;a&nbsp;=&nbsp;1.1;&nbsp;1.1\u662f\u5b57\u9762\u91cf&nbsp;\u8fd9\u6837\u4f1a\u4f7f\u5f97\u5411\u4e0b\u8f6c\u578b\uff0c\u4f1a\u4e22\u5931\u7cbe\u5ea6<\/span><br  \/><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6b63\u786e\u7684\u5199\u6cd5\uff1a<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">float<\/span>&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1.1f<\/span>;<br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">double<\/span>&nbsp;b&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1.1<\/span>;<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9690\u5f0f\u8f6c\u6362:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">short<\/span>&nbsp;c&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>;<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/ 1\u662fint\u578b&nbsp;&nbsp;\u7cbe\u5ea6\u6bd4short\u9ad8&nbsp;\u6ca1\u53d1\u9690\u5f0f\u7684\u5411\u4e0b\u8f6c\u578b\u6210short<\/span><br  \/><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd9\u6837\u53ef\u4ee5\u8fbe\u5230\u9690\u5f0f\u8f6c\u6362\u7684\u76ee\u7684<\/span><br  \/>&nbsp;&nbsp;c&nbsp;++;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;c&nbsp;=&nbsp;(short)&nbsp;(c&nbsp;+&nbsp;1);<\/span><br  \/><\/code><\/pre>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u6d41\u7a0b\u63a7\u5236<\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u8bf4\u8bdd\u7684\u65f6\u5019\u4f1a\u6709\u903b\u8f91\u8bed\u53e5\uff0c\u7a0b\u5e8f\u4e5f\u4e00\u6837\uff0c\u6709\u4e86\u5b83\uff0c\u5c31\u80fd\u63a7\u5236\u7a0b\u5e8f\u5728\u8bbe\u5b9a\u4e2d\u8fd0\u884c\uff0c\u4e3e\u4e2a\u4f8b\u5b50\uff0c \u201c\u5982\u679c\u6211\u6559\u4f60\u5199java, \u4f60\u5c31\u505a\u6211\u5973\u670b\u53cb\u201d<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5728java\u4e2d\u7528&nbsp;<span style=\"color:#3eaf7c;\">if<\/span>&nbsp;\u8868\u793a\uff1a<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd9\u91cc\u7684true\u662fboolean\u7c7b\u578b\uff0c&nbsp;\u5728\u6570\u5b66\u4e2d\u53eb\u771f,\u76f8\u53cd\u7684\u662f&nbsp;false<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">true<\/span>)&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u505a\u6211\u5973\u670b\u53cb\"<\/span>);<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5982\u679c\u5979\u62d2\u7edd\u4e86\u548b\u529e? \u5e76\u5bf9\u4f60\u8bf4\u4e86\u53e5 \"go out !\", \u5728java\u4e2d\u7528&nbsp;<span style=\"color:#3eaf7c;\">else<\/span>&nbsp;\u8868\u793a\u5426\u5219\u7684\u610f\u601d\uff0c\u7c7b\u4f3c\u8f6c\u6298\u8bed\u53e5:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">true<\/span>)&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u505a\u6211\u5973\u670b\u53cb\"<\/span>);<br  \/>}<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">else<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u6eda\"<\/span>);<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4f60\u8fd8\u4e0d\u60f3\u653e\u5f03\uff0c\u6211\u5728\u5916\u52a0\u8bf7\u4f60\u5403\u996d+\u770b\u7535\u5f71, \u5728java\u4e2d\u6211\u4eec\u53ef\u4ee5\u7528&nbsp;<span style=\"color:#3eaf7c;\">else if<\/span>&nbsp;\u8fd9\u4e48\u8868\u793a, \u7c7b\u4f3c\u4e8c\u6b21\u8f6c\u6298\uff1a<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7b2c1\u5c42\u5224\u65ad<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(\u6559\u4f60\u5199\u4ee3\u7801)&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u505a\u6211\u5973\u670b\u53cb\"<\/span>);<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7b2c2\u5c42\u5224\u65ad<\/span><br  \/>}<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">else<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(\u5403\u996d)&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u505a\u6211\u5973\u670b\u53cb\"<\/span>);<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7b2c3\u5c42\u5224\u65ad<\/span><br  \/>}<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">else<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(\u770b\u7535\u5f71)&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u505a\u6211\u5973\u670b\u53cb\"<\/span>);<br  \/>}<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">else<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u7b2c4\u5c42\u5224\u65ad<\/span><br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u6eda\"<\/span>);<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5728\u4f60\u7684\u4e0d\u65ad\u52aa\u529b\u4e0b\uff0c\u5979\u7ec8\u4e8e\u7b54\u5e94\u8ddf\u4f60\u5403\u996d\u4e86\uff0c\u8fd9\u65f6\u5019\u4f60\u8981\u5f00\u59cb\u60f3\u4e86\u4e00\u4e0b\u9884\u7b97\uff0c\u90a3\u4e48\u9884\u7b97\u53ef\u80fd\u4f1a\u6709\u5f88\u591a\u79cd\u3002\u5728java\u4e2d\u4f7f\u7528 switch\u6765\u8fdb\u884c\u591a\u79cd\u5224\u65ad\uff0c\u4e3a\u5565\u4e0d\u662fif\uff0cif\u4e5f\u53ef\u4ee5\uff0c\u4f46\u662f\u591a\u8d77\u6765\u4f1a\u5bfc\u81f4if\u591a\u5c42\u5d4c\u5957\uff0c\u4e0d\u5229\u4e8e\u4ee3\u7801\u7ef4\u62a4\u3002\u8bf4\u4e0d\u5b9a\u4f60\u4e0b\u6b21\u6539bug\u4f60\u90fd\u4e0d\u77e5\u9053\u5199\u4e86\u5565\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5f53\u7136\u4e5f\u4e0d\u5b8c\u5168\u662f&nbsp;<span style=\"color:#3eaf7c;\">switch<\/span>&nbsp;\u6211\u4eec\u53ef\u4ee5\u62c6\u5206\u65b9\u6cd5\uff0c\u7c7b\u7b49\u7b49\u3002\u8fd9\u91cc\u4e3a\u4e86\u719f\u6089\u8bed\u6cd5:<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u652f\u6301\u7684\u5224\u65ad\u7c7b\u578b \uff1a\u9700\u8981 char\u3001byte\u3001short\u3001int\u3001Character\u3001Byte\u3001Short\u3001Integer\u3001String \u6216\u679a\u4e3e \u4e0d\u652f\u6301: long\u3001float\u3001double<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5047\u8bbecost&nbsp;\u4e3aint\u578b\uff0c&nbsp;\u610f\u601d\u662f\u82b1\u8d39<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">switch<\/span>(cost)&nbsp;{<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">case<\/span>&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">200<\/span>:<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.ingo(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u5403\u80af\u5fb7\u57fa\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;break&nbsp;\u610f\u601d\u662f\u8df3\u51fa\u5faa\u73af&nbsp;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">break<\/span>;<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">case<\/span>&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">100<\/span>:<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.ingo(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u6c49\u5821\u738b\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">break<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/ default\uff1a&nbsp;\u5f53\u4ee5\u4e0a\u6761\u4ef6\u4e0d\u6ee1\u8db3\u7684\u65f6\u5019\u4f1a\u9ed8\u8ba4\u6267\u884c\u8fd9\u4e2a\u8bed\u53e5<\/span><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">default<\/span>:<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.ingo(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u5403\u714e\u997c\u679c\u5b50\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">break<\/span>;<br  \/>}<br  \/><br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fd8\u662f\u521a\u521a\u7684\u4f8b\u5b50\uff0c \u5403\u5b8c\u996d\u540e\uff0c\u51c6\u5907\u770b\u7535\u5f71\uff0c\u5973\u795e\u8bf4\u4e86\u523010\u70b9\uff0c\u770b\u6ca1\u770b\u5b8c\u90fd\u56de\u5bb6\uff0c\u8fd9\u65f6\u5019\u4f60\u4e00\u76f4\u76ef\u7740\u770b\u65f6\u95f4\uff0c\u751f\u6015\u65f6\u95f4\u5230\u4e86\uff0c\u4e2d\u9014\u4f60\u8fd8\u4e0a\u4e86\u4e2a\u5395\u6240, \u5fd8\u4e86\u6570\u6570\u4e86\u3002\u5b9e\u9645\u4e0a\u8fd9\u662f\u4e00\u79cd\u5faa\u73af\u7684\u573a\u666f\uff0c\u4e00\u76f4\u5728\u68c0\u6d4b\u67d0\u4e00\u73af\u8282\u4e0b\u6ee1\u8db3\u67d0\u79cd\u6761\u4ef6\u65f6\uff0c\u6267\u884c\u5bf9\u5e94\u7684\u4efb\u52a1,\u5728java\u4e2d\u6211\u4eec\u901a\u5e38\u7528&nbsp;<span style=\"color:#3eaf7c;\">while<\/span>&nbsp;\u6765\u8868\u793a,while\u7c7b\u4f3c\u5f53...\u4ec0\u4e48\u65f6\u5019\u3002<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">#&nbsp;\u6ca1\u5230\u5341\u70b9&nbsp;\u4f1a\u4e00\u76f4\u6267\u884c<br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">while<\/span>(\u6ca1\u5230\u5341\u70b9)&nbsp;{<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u914d\u5408if&nbsp;\u5b9e\u73b0\uff0c&nbsp;\u8df3\u51fa\u5faa\u73af<\/span><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(\u5341\u70b9\u5230\u4e86)&nbsp;{&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">break<\/span>;<br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u4e0a\u5395\u6240&nbsp;\u5fd8\u4e86\u770b\u65f6\u95f4\u4e86<\/span><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>(\u4e0a\u5395\u6240)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;continue&nbsp;\u8868\u793a\u8df3\u51fa\u5f53\u524d\u8fd9\u4e2a\u65f6\u523b\uff0c\u4f46\u4e0d\u4f1a\u7ec8\u6b62\u5faa\u73af,&nbsp;\u4e0b\u4e00\u6b21\u8fd8\u662f\u63a5\u7740\u6570\u6570<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">continue<\/span>;<br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u8fd8\u5269.xx.\u5206\u949f\"<\/span>)<br  \/>}<br  \/><br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u7136\u540e\u65f6\u95f4\u5230\u4e86\uff0c\u4f60\u4eec\u4e00\u8d77\u8d70\u5728\u56de\u5bb6\u7684\u8def\u4e0a\uff0c\u5fc3\u60f3\uff0c\u51fa\u90fd\u51fa\u6765\u4e86\uff0c\u81f3\u5c11\u62c9\u4e00\u6b21\u624b\uff0c \u6700\u7ec8\u6210\u529f\u4e86\u3002\u8fd9\u79cd\u573a\u666f\u5c5e\u4e8e\u3002\u8fd9\u79cd\u573a\u666f\u5c5e\u4e8e\uff0c\u4e0d\u7ba1\u5931\u8d25\u4e0e\u5426\uff0c\u4e8b\u4ef6\u90fd\u4f1a\u6267\u884c\u4e00\u6b21\uff0c\u5728Java\u4e2d\u7528&nbsp;&nbsp;<span style=\"color:#3eaf7c;\">do ... while<\/span>:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">do<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u62c9\u624b)<br  \/>}&nbsp;while(false)<br  \/><br  \/><\/span><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6700\u7ec8\u5973\u795e\u8ddf\u4f60\u8bf4\u4e86\u53e5\uff1a\u201c\u4f60\u662f\u597d\u4eba\u201d\uff0c\u4f60\u542c\u4e86\u4e4b\u540e\u611f\u52a8\u7684\u54ed\u4e86\u3002<\/p>\n<figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"0.9890625\"  data-type=\"jpeg\" data-w=\"640\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042437183.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.9890625\"  data-type=\"jpeg\" data-w=\"640\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042437183.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u591a\u559d\u70ed\u6c34<\/figcaption><\/figure>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u5305\u88c5\u7c7b\u578b<\/span><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u524d\u65b9\u9ad8\u80fd\uff0c \u5982\u679c\u4f60\u662f\u5c0f\u767d\uff0c\u53ef\u80fd\u770b\u7684\u4f1a\u6709\u70b9\u7cca\u6d82 ~<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u57fa\u672c\u7c7b\u578b\u90fd\u6709\u5bf9\u5e94\u7684\u5305\u88c5\u7c7b\u578b\uff0c\u57fa\u672c\u7c7b\u578b\u4e0e\u5176\u5bf9\u5e94\u7684\u5305\u88c5\u7c7b\u578b\u4e4b\u95f4\u7684\u8d4b\u503c\u4f7f\u7528\u81ea\u52a8\u88c5\u7bb1\u4e0e\u62c6\u7bb1\u5b8c\u6210, \u8fd9\u91cc\u4ecb\u7ecd\u5e38\u7528\u7684\u5305\u88c5\u7c7b\u578b, \u4ed6\u4eec\u5c5e\u4e8e\u5f15\u7528\u7c7b\u578b\uff0c\u56e0\u4e3a\u4ed6\u4eec\u672c\u8eab\u4e5f\u662f\u4e00\u4e2a\u5bf9\u8c61&nbsp;<span style=\"color:#3eaf7c;\">\u7c7b<\/span><\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">Integer<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u901a\u5e38\u7528\u4e8e\u6574\u6570\u5f62\uff0c\u4e3e\u4e2a\u4f8b\u5b50:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;Integer&nbsp;x&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">2<\/span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u88c5\u7bb1&nbsp;\u8c03\u7528\u4e86&nbsp;Integer.valueOf(2)<\/span><br  \/>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;y&nbsp;=&nbsp;x;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u62c6\u7bb1&nbsp;\u8c03\u7528\u4e86&nbsp;X.intValue()<\/span><br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">Integer\u5185\u90e8\u6709\u4e00\u4e2a\u7f13\u51b2\u6c60\uff0c\u7f13\u51b2\u6c60\u53ef\u4ee5\u6709\u6548\u7684\u5e2e\u6211\u4eec\u7f13\u5b58\u5bf9\u8c61\uff0c\u4ece\u800c\u51cf\u5c11\u5bf9\u8c61\u7684\u9891\u7e41\u521b\u5efa, Java 8 \u4e2d\uff0cInteger \u7f13\u5b58\u6c60\u7684\u5927\u5c0f\u9ed8\u8ba4\u4e3a&nbsp;<span style=\"color:#3eaf7c;\">-128~127<\/span>&nbsp;\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6e90\u7801\u53ef\u4ee5\u770b\u5230:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;range&nbsp;[-128,&nbsp;127]&nbsp;must&nbsp;be&nbsp;interned&nbsp;(JLS7&nbsp;5.1.7)<\/span><br  \/>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">assert<\/span>&nbsp;IntegerCache.high&nbsp;&gt;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">127<\/span>;<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5176\u4e2d&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">java new Integer(123)<\/code>&nbsp;\u76f8\u5f53\u4e8e\u65b0\u5efa\u4e00\u4e2a\u5bf9\u8c61, \u5f53\u6211\u4eec\u518d\u8c03\u7528&nbsp;<code style=\"word-wrap: break-word;padding: 2px 4px;border-top-left-radius: 4px;border-top-right-radius: 4px;border-bottom-right-radius: 4px;border-bottom-left-radius: 4px;margin-right: 2px;margin-left: 2px;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;word-break: break-all;color: rgb(145, 109, 213);background-image: none;\">java Integer.valueOf(123)<\/code>&nbsp;\u5f15\u7528\u7684\u5c31\u662f\u540c\u4e00\u4e2a\u5bf9\u8c61 \u3002\u6b64\u5916, <span style=\"color:#3eaf7c;\">Integer<\/span>&nbsp;\u4e0d\u53ef\u88ab\u7ee7\u627f\uff0c \u56e0\u4e3a\u5b83\u7684\u7c7b\u662ffinal\u4fee\u9970\u7684\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">valueOf()&nbsp;<\/span>\u65b9\u6cd5\u7684\u5b9e\u73b0\uff0c \u5148\u5224\u65ad\u503c\u662f\u5426\u5728\u7f13\u5b58\u6c60\u4e2d\uff0c\u5982\u679c\u5728\u7684\u8bdd\u5c31\u76f4\u63a5\u8fd4\u56de\u7f13\u5b58\u6c60\u7684\u5185\u5bb9\uff0c \u5bf9\u5e94\u7684\u6e90\u7801\u5982\u4e0b:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;Integer&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">valueOf<\/span><span style=\"line-height: 26px;\">(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;i)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>&nbsp;(i&nbsp;&gt;=&nbsp;Integer.IntegerCache.low&nbsp;&amp;&amp;&nbsp;i&nbsp;&lt;=&nbsp;Integer.IntegerCache.high)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;Integer.IntegerCache.cache[i&nbsp;+&nbsp;(-Integer.IntegerCache.low)];<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;Integer(i);<br  \/>}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u770b\u5230\u8fd9\u91cc\uff0c \u901a\u8fc7\u4e00\u4e2a\u4f8b\u5b50\u6765\u611f\u53d7\u4e00\u4e0b:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;&nbsp;Integer&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;Integer(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">123<\/span>);<br  \/>&nbsp;&nbsp;Integer&nbsp;b&nbsp;=&nbsp;Integer.valueOf(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"123\"<\/span>);<br  \/>&nbsp;&nbsp;Integer&nbsp;c&nbsp;=&nbsp;Integer.valueOf(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">123<\/span>);<br  \/><br  \/>&nbsp;&nbsp;System.err.println(a&nbsp;==&nbsp;b);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false<\/span><br  \/>&nbsp;&nbsp;System.err.println(a&nbsp;==&nbsp;c);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false<\/span><br  \/>&nbsp;&nbsp;System.err.println(c&nbsp;==&nbsp;b);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u81ea\u52a8\u88c5\u7bb1,&nbsp;\u7f16\u8bd1\u5668\u4f1a\u81ea\u52a8\u8c03\u7528&nbsp;valueOf<\/span><br  \/>&nbsp;&nbsp;Integer&nbsp;d&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">123<\/span>;<br  \/>&nbsp;&nbsp;Integer&nbsp;e&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">124<\/span>;<br  \/>&nbsp;&nbsp;Integer&nbsp;f&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">123<\/span>;<br  \/>&nbsp;&nbsp;System.err.println(d&nbsp;==&nbsp;e);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false&nbsp;\u56e0\u4e3a\u503c\u4e0d\u4e00\u6837<\/span><br  \/>&nbsp;&nbsp;System.err.println(f&nbsp;==&nbsp;d);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u8bf4\u9ed8\u8ba4\u7684\u7f13\u51b2\u6c60\u5927\u5c0f\u4e3a&nbsp;<span style=\"color:#3eaf7c;\">-128~127<\/span>&nbsp;\uff0c\u90a3\u4e48\u5982\u679c\u8d85\u8fc7\u4e86\u600e\u4e48\u529e\u3002\u4ece\u6e90\u7801\u770b\uff0c\u5185\u90e8\u4f1a\u6839\u636e\u4f20\u8fdb\u53bb\u7684 i \u8fdb\u884c&nbsp;<span style=\"color:#3eaf7c;\">\u52a8\u6001\u6269\u5bb9<\/span><\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6e90\u7801\u90e8\u5206:<\/span><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">IntegerCache<\/span>&nbsp;<\/span>{<br  \/>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">final<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;low&nbsp;=&nbsp;-<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">128<\/span>;<br  \/>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">final<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;high;<br  \/>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">final<\/span>&nbsp;Integer&nbsp;cache[];<br  \/><br  \/>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;high&nbsp;value&nbsp;may&nbsp;be&nbsp;configured&nbsp;by&nbsp;property<\/span><br  \/>&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;h&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">127<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;String&nbsp;integerCacheHighPropValue&nbsp;=&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;sun.misc.VM.getSavedProperty(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"java.lang.Integer.IntegerCache.high\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>&nbsp;(integerCacheHighPropValue&nbsp;!=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">try<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;i&nbsp;=&nbsp;parseInt(integerCacheHighPropValue);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i&nbsp;=&nbsp;Math.max(i,&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">127<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;Maximum&nbsp;array&nbsp;size&nbsp;is&nbsp;Integer.MAX_VALUE<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;h&nbsp;=&nbsp;Math.min(i,&nbsp;Integer.MAX_VALUE&nbsp;-&nbsp;(-low)&nbsp;-<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">catch<\/span>(&nbsp;NumberFormatException&nbsp;nfe)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;If&nbsp;the&nbsp;property&nbsp;cannot&nbsp;be&nbsp;parsed&nbsp;into&nbsp;an&nbsp;int,&nbsp;ignore&nbsp;it.<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;high&nbsp;=&nbsp;h;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;cache&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;Integer[(high&nbsp;-&nbsp;low)&nbsp;+&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>];<br  \/>&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;j&nbsp;=&nbsp;low;<br  \/>&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">for<\/span>(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;k&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">0<\/span>;&nbsp;k&nbsp;&lt;&nbsp;cache.length;&nbsp;k++)<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cache[k]&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;Integer(j++);<br  \/><br  \/>&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;range&nbsp;[-128,&nbsp;127]&nbsp;must&nbsp;be&nbsp;interned&nbsp;(JLS7&nbsp;5.1.7)<\/span><br  \/>&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">assert<\/span>&nbsp;Integer.IntegerCache.high&nbsp;&gt;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">127<\/span>;<br  \/>&nbsp;}<br  \/><br  \/>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">IntegerCache<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{}<br  \/>}&nbsp;<br  \/><\/code><\/pre>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">String<\/span><\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8be5\u7c7b\u578b\u901a\u5e38\u7528\u4e8e\u8868\u793a\u5b57\u7b26\u4e32\u5bf9\u8c61, \u548cInteger\u4e00\u6837\uff0c\u5b83\u4e5f\u662ffinal\u4fee\u9970\u7684\u4e0d\u53ef\u7ee7\u627f\uff0c \u6e90\u7801\u5b9a\u4e49\u5982\u4e0b:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">final<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">String<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">java<\/span>.<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">io<\/span>.<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Serializable<\/span>,&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Comparable<\/span>&lt;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">String<\/span>&gt;,&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">CharSequence<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;java8:&nbsp;\u4f7f\u7528char\u6570\u7ec4<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">final<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">char<\/span>&nbsp;value[];<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u4f7f\u7528final\u4fee\u9970\u7684\u6570\u7ec4&nbsp;\u53ef\u4ee5\u4fdd\u8bc1&nbsp;String&nbsp;\u4e0d\u53ef\u53d8<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;java&nbsp;9<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">final<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">byte<\/span>[]&nbsp;value;<br  \/>&nbsp;&nbsp;}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u521d\u59cb\u503cchar\u6570\u7ec4\u662f\u7528finnal\u7a00\u91ca\u7684,\u8fd9\u6837\u4fdd\u8bc1&nbsp;&nbsp;<span style=\"color:#3eaf7c;\">String\u5bf9\u8c61<\/span>&nbsp;\u4e0d\u53ef\u53d8\u7684\u597d\u5904\u662f\u4ec0\u4e48\uff1f<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u53ef\u4ee5\u4f5c\u4e3a hash\u7684 key, \u53ef\u4ee5\u8ba9hash\u503c\u4e5f\u4e0d\u53ef\u53d8, \u53ea\u9700\u8fdb\u884c\u4e00\u6b21\u8ba1\u7b97\uff0c \u53ef\u4ee5\u9632\u6b62key\u91cd\u590d\uff0c \u5728map\u53d6\u503c\u7684\u65f6\u5019 \u4f1a\u901a\u8fc7\u8ba1\u7b97\uff0chashCode() \u548c equals\u6765\u5224\u65adkey, \u800cString\u7684hashCode\u662f\u6839\u636e char[]\u6570\u7ec4\u5185\u5bb9\u6765\u8ba1\u7b97\u5f97\u5230\u7684\u6563\u5217\u7801\uff0c\u5982\u679c\u76f8\u540c\u7684\u5185\u5bb9\u4e0b\uff0c\u90a3\u4e48key\u662f\u4e0d\u53ef\u53d8\u7684<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">String\u7684\u7f13\u5b58\u6c60\uff0c \u5982\u679c\u4e00\u4e2aString\u88ab\u521b\u5efa\u8fc7\u4e86\uff0c \u518d\u6b21\u83b7\u53d6\u53ef\u4ee5\u4ece\u7f13\u5b58\u6c60\u4e2d\u83b7\u53d6\uff0c\u5982\u679cString\u53ef\u53d8\u7684\u8bdd \u5c31\u6ca1\u6cd5\u4f7f\u7528\u7f13\u5b58\u6c60\u4e86<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u5b89\u5168\u6027\u3002String\u5e38\u7528\u505a\u53c2\u6570<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u5929\u751f\u7ebf\u7a0b\u5b89\u5168 \u56e0\u4e3a\u5b83\u4e0d\u53ef\u53d8<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">String, StringBuffer and StringBuilder \u4e09\u8005\u8054\u7cfb\uff1f\u6211\u4eec\u901a\u8fc7\u4ee5\u4e0b\u51e0\u70b9\u8fdb\u884c\u6bd4\u8f83:<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u53ef\u53d8\u6027:<\/p>\n<\/section>\n<\/li>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;font-size: 15px;list-style-type: square;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">String \u4e0d\u53ef\u53d8 (\u4e0d\u53ef\u53d8\u53ea\u7684\u662f\u672c\u8eab\u4e0d\u53ef\u53d8\uff0c \u672c\u8d28\u4e0a\u5b83\u7684\u64cd\u4f5c\u90fd\u4f1a\u4ea7\u751f\u65b0\u7684Object)<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">StringBuffer and StringBuilder \u53ef\u53d8 ( \u5e76\u4e0d\u4f1a\u4ea7\u751f\u65b0\u7684Object ,\u5229\u7528\u7684\u662f\u7f13\u5b58\u6c60)<\/section>\n<\/li>\n<\/ul>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u7ebf\u7a0b\u5b89\u5168:<\/p>\n<\/section>\n<\/li>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;font-size: 15px;list-style-type: square;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">String\uff08\u901a\u8fc7finnal\uff09, StringBuffer(\u901a\u8fc7 synchronized\u8fdb\u884c\u540c\u6b65 )<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">StringBuilder \u4e0d\u662f\u7ebf\u7a0b\u5b89\u5168\u7684<\/section>\n<\/li>\n<\/ul>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u4f7f\u7528\u573a\u666f:<\/p>\n<\/section>\n<\/li>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;font-size: 15px;list-style-type: square;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">String \u9002\u5408\u4e0d\u9700\u8981\u9891\u7e41\u4fee\u6539\u5b57\u7b26\u4e32<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">StringBuilder \u4f18\u5148\u4f7f\u7528\uff0c\u9891\u7e41\u4fee\u6539\u5b57\u7b26\u4e32\u65f6<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5728\u8003\u8651\u591a\u7ebf\u7a0b\u5171\u4eab\u53d8\u91cf\u65f6\u4f7f\u7528 StringBuffer<\/section>\n<\/li>\n<\/ul>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u7ee7\u627f\u5173\u7cfb:<\/p>\n<\/section>\n<\/li>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;color: black;font-size: 15px;list-style-type: square;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">StringBuffer,StringBuilder \u90fd\u7ee7\u627f\u4e86 AbstractStringBuilder<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">StringBuffer,StringBuilder\uff0cString \u90fd\u4e0d\u53ef\u88ab\u7ee7\u627f<\/section>\n<\/li>\n<\/ul>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u8bf4&nbsp;<span style=\"color:#3eaf7c;\">Integer<\/span>&nbsp;\u6709\u7f13\u51b2\u6c60\uff0c\u90a3\u4e48String\u662f\u4e0d\u662f\u4e5f\u6709\u5462\uff1f\u7b54\u6848\u662f\u6709\u7684\u3002\u6211\u4eec\u901a\u5e38\u53eb\u5b83&nbsp;<span style=\"color:#3eaf7c;\">\u5e38\u91cf\u6c60<\/span>&nbsp;\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5728 Java 7 \u4e4b\u524d\uff0cString Pool \u88ab\u653e\u5728\u8fd0\u884c\u65f6\u5e38\u91cf\u6c60\u4e2d\uff0c\u5b83\u5c5e\u4e8e\u6c38\u4e45\u4ee3\u3002\u800c\u5728 Java 7\uff0cString Pool \u88ab\u79fb\u5230\u5806\u4e2d\uff0c\u8fd9\u662f\u56e0\u4e3a\u6c38\u4e45\u4ee3\u7684\u7a7a\u95f4\u6709\u9650\uff0c\u5728\u5927\u91cf\u4f7f\u7528\u5b57\u7b26\u4e32\u7684\u573a\u666f\u4e0b\u4f1a\u5bfc\u81f4 OutOfMemoryError \u9519\u8bef\uff0c \u4e0d\u61c2\u5565\u4ee3\u7684\u53ef\u4ee5\u5148\u653e\u653e\uff0c\u8fd9\u5c5e\u4e8ejvm\u7684\u73af\u8282\uff0c\u540e\u8fb9\u4f1a\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">String.intern()<\/span>&nbsp;\u65b9\u6cd5: \u5982\u679c\u5b57\u7b26\u4e32\u5e38\u91cf\u6c60\u5305\u542b\u4e86\u8fd9\u4e2aString\u5bf9\u8c61\uff0c\u5219\u76f4\u63a5\u8fd4\u56de\u8be5\u5bf9\u8c61\uff0c \u5426\u5219\u91cd\u65b0\u751f\u6210\u5bf9\u8c61\uff0c \u5e76\u8fd4\u56de, \u4e3e\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;&nbsp;StringBuilder&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;StringBuilder(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"hello\"<\/span>);<br  \/>&nbsp;&nbsp;StringBuilder&nbsp;b&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;StringBuilder(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"hello\"<\/span>);<br  \/>&nbsp;&nbsp;StringBuilder&nbsp;c&nbsp;=&nbsp;a.append(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\"<\/span>);<br  \/><br  \/>&nbsp;&nbsp;System.out.println(a&nbsp;==&nbsp;b);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false&nbsp;\u4e24\u4e2anew&nbsp;\u4e0d\u540c\u5bf9\u8c61<\/span><br  \/>&nbsp;&nbsp;System.out.println(a&nbsp;==&nbsp;c);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true&nbsp;append\u64cd\u4f5c\u540c\u4e00\u4e2a\u5bf9\u8c61<\/span><br  \/><br  \/>&nbsp;&nbsp;String&nbsp;x&nbsp;=&nbsp;a.toString().intern();<br  \/>&nbsp;&nbsp;String&nbsp;y&nbsp;=&nbsp;b.toString().intern();<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"x&nbsp;-----&nbsp;y\"<\/span>);<br  \/>&nbsp;&nbsp;Log.info(x&nbsp;==&nbsp;y);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u539f\u56e0:<\/span><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;String.intern&nbsp;\u64cd\u4f5c\u4f1a\u628a&nbsp;a&nbsp;\u5b57\u7b26\u4e32\u653e\u5230String&nbsp;pool&nbsp;\u5e76\u8fd4\u56de\u5b57\u7b26\u4e32\u7684\u5f15\u7528<\/span><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;b.intern\u64cd\u4f5c&nbsp;\u4f1a\u53bbString&nbsp;pool\u4e2d\u83b7\u53d6&nbsp;\u53d1\u73b0\u5b57\u7b26\u4e32\u4e00\u6837\uff0c\u6240\u4ee5\u76f4\u63a5\u8fd4\u56de&nbsp;a\u7684\u5f15\u7528<\/span><br  \/><br  \/>&nbsp;&nbsp;String&nbsp;z&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"hello\"<\/span>;<br  \/>&nbsp;&nbsp;String&nbsp;m&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"hello\"<\/span>;<br  \/>&nbsp;&nbsp;Log.info(x&nbsp;==&nbsp;y);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u76f4\u63a5\u4f7f\u7528\u5b57\u9762\u91cf\u521b\u5efa\u65f6\uff0c&nbsp;\u4f1a\u81ea\u52a8\u52a0\u5165&nbsp;String&nbsp;Pool\u4e2d<\/span><br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fd9\u91cc\u5f15\u7533\u4e00\u4e2a\u9762\u8bd5\u9898\uff0c \u7b54\u6848\u76f4\u63a5\u8d34\u7ed9\u5927\u5bb6:<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;String&nbsp;java&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;StringBuilder(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"ja\"<\/span>).append(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"va\"<\/span>).toString();<br  \/>&nbsp;&nbsp;Log.info(java);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;java<\/span><br  \/>&nbsp;&nbsp;Log.info(java&nbsp;==&nbsp;java.intern());&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/><br  \/><br  \/>&nbsp;&nbsp;String&nbsp;go&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;StringBuilder(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"g\"<\/span>).append(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"o\"<\/span>).toString();<br  \/>&nbsp;&nbsp;Log.info(go);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;go<\/span><br  \/>&nbsp;&nbsp;Log.info(go&nbsp;==&nbsp;go.intern());&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true<\/span><br  \/><br  \/>&nbsp;&nbsp;String&nbsp;java1&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;StringBuilder(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"ja\"<\/span>).append(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"va\"<\/span>).toString();<br  \/>&nbsp;&nbsp;Log.info(java1);&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;java<\/span><br  \/>&nbsp;&nbsp;Log.info(java1&nbsp;==&nbsp;java1.intern());&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false<\/span><br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e0a\u8ff0string builder ,\u8fdb\u884c\u7c7b\u52a0\u8f7d\u540e, \u8c03\u7528\u7684\u65f6\u5019\u5185\u90e8\u9ed8\u8ba4\u4f1a\u751f\u6210\u4e00\u4e2ajava\u7684String \u5bf9\u8c61\uff08java jdk \u81ea\u8eab\u7684\u539f\u56e0, sum.misc.Version \u7c7b\u6ce8\u5165\u5e38\u91cf\u6c60 \uff09<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5173\u4e8e new String<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fd9\u79cd\u65b9\u5f0f\u521b\u5efa\u5b57\u7b26\u4e32\u4f1a\u83b7\u5f97\u4e24\u4e2a\u5bf9\u8c61,<\/p>\n<ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u7f16\u8bd1\u65f6\u671f \u5b58\u5728String Pool \u6307\u5411 String\u7684\u5b57\u9762\u91cf<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5b58\u5728\u5806\u4e2d\u7684 String\u5bf9\u8c61<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4ee5\u4e0b\u662f String \u6784\u9020\u51fd\u6570\u7684\u6e90\u7801\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u5728\u5c06\u4e00\u4e2a\u5b57\u7b26\u4e32\u5bf9\u8c61\u4f5c\u4e3a\u53e6\u4e00\u4e2a\u5b57\u7b26\u4e32\u5bf9\u8c61\u7684\u6784\u9020\u51fd\u6570\u53c2\u6570\u65f6\uff0c\u5e76\u4e0d\u4f1a\u5b8c\u5168\u590d\u5236 value \u6570\u7ec4\u5185\u5bb9, \u800c\u662f\u90fd\u4f1a\u6307\u5411\u540c\u4e00\u4e2a value \u6570\u7ec4\u3002<\/p>\n<pre data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">final<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">char<\/span>&nbsp;value[];<br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">String<\/span><span style=\"line-height: 26px;\">(String&nbsp;original)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.value&nbsp;=&nbsp;original.value;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.hash&nbsp;=&nbsp;original.hash;<br  \/>&nbsp;&nbsp;}<br  \/><\/code><\/pre>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color: rgb(145, 109, 213);\">\u6ca1\u5173\u7cfb\uff0c\u4ee3\u7801\u80fd\u8dd1\u5c31\u884c ~<\/span><\/p>\n<p><imgbox name=\"fangguo\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><noscript><imgbox name=\"fangguo\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><\/noscript><\/p>\n<h2 style=\"font-weight: bold;font-size: 22px;margin-top: 20px;margin-right: 10px;\"><span style=\"font-size: 18px;display: inline-block;padding-left: 10px;border-left-width: 5px;border-left-style: solid;border-left-color: rgb(145, 109, 213);\">\u9762\u5411\u5bf9\u8c61<\/span><\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color:#3eaf7c;\">\u9762\u5411\u5bf9\u8c61<\/span>&nbsp;\u662f\u4e00\u79cd\u7f16\u7a0b\u601d\u60f3\uff0c\u4e0d\u4ec5\u4ec5\u5728java\uff0c\u5176\u5b83\u8bed\u8a00\u53ef\u4ee5\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u6cd5\u8f6e\uff0c\u6211\u4eec\u53ef\u4ee5\u7f16\u5199\u5229\u4e8e\u7ef4\u62a4\u7684\u4ee3\u7801\uff0c\u8ba9\u6211\u4eec\u7684\u4ee3\u7801\u66f4\u52a0\u6761\u7406\uff0c\u66f4\u52a0\u7684\u6709\u827a\u672f\uff0c\u6709\u4e86\u5b83\uff0c\u540e\u6765\u53c8\u5f15\u5165\u4e86&nbsp;<span style=\"color:#3eaf7c;\">java\u8bbe\u8ba1\u6a21\u5f0f<\/span>, \u5b83\u4e5f\u662f\u4e00\u79cd\u7f16\u7a0b\u65b9\u6cd5\uff0c \u53ef\u4ee5\u628a\u5b83\u7406\u89e3\u4e3a\u8bed\u6587\u4e2d\u7684\u5199\u4f5c\u65b9\u6cd5\u3002<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u9762\u5411\u5bf9\u8c61\u548c\u9762\u5411\u8fc7\u7a0b?<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u7f51\u4e0a\u4ecb\u7ecd\u7684\u4e5f\u5f88\u591a\uff0c\u4f46\u662f\u4ecb\u7ecd\u7684\u6709\u70b9\u590d\u6742\uff0c \u8fd9\u91cc\u7ed9\u5927\u5bb6\u63d0\u70bc\u51e0\u4e2a\u5173\u952e\u5b57:<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9762\u5411\u5bf9\u8c61 : \u8c01\u505a\u4e86\u67d0\u4ef6\u4e8b \uff08\u4e3b\u4f53\u5bf9\u8c61\u662f\u8c01\uff09<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9762\u5411\u8fc7\u7a0b: \u505a\u4e86\u8c01\u7684\u67d0\u4ef6\u4e8b \uff08\u6ca1\u6709\u4e3b\u4f53\u5bf9\u8c61\uff0c\u4e00\u80a1\u52b2\u7684\u505a\uff09<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u7c7b\u548c\u65b9\u6cd5<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5728java\u4e2d\uff0c\u6211\u4eec\u7528\u7c7b\u6765\u5b9e\u73b0\u9762\u5411\u5bf9\u8c61\uff0c\u6211\u4eec\u7528java\u63cf\u8ff0\u4e00\u4e2a\u82f9\u679c\u5bf9\u8c61:<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Apple<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;Sting&nbsp;color;<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e0a\u9762\u5b9a\u4e49\u4e86\u4e00\u4e2aApple\u7c7b\uff0c\u5185\u90e8\u6709\u4e00\u4e2acolor\u7684\u5c5e\u6027\uff0c\u5982\u679c\u6211\u4eec\u4e00\u5f00\u59cb\u60f3\u8981\u7ea2\u8272\u7684\u82f9\u679c\uff0c\u5728java\u4e2d\u53ef\u4ee5\u4f7f\u7528\u6784\u9020\u51fd\u6570\uff1a<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Apple<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;Sting&nbsp;color;<br  \/>&nbsp;&nbsp;<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5b8c\u6210\u521d\u59cb\u5316<\/span><br  \/>&nbsp;&nbsp;Apple(String&nbsp;color)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u60f3\u540e\u671f\u6539\u989c\u8272\u600e\u4e48\u529e, \u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7c7b\u7684\u65b9\u6cd5:<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Apple<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;Sting&nbsp;color;<br  \/>&nbsp;&nbsp;<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5b8c\u6210\u521d\u59cb\u5316<\/span><br  \/>&nbsp;&nbsp;Apple(String&nbsp;color)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u65b9\u6cd5<\/span><br  \/>&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;void\u6307\u5b9a\u7684\u662f\u8fd4\u56de\u503c\u7684\u7c7b\u578b\uff0c&nbsp;\u7528void\u8868\u793a\u65e0\u8fd4\u56de\u503c<\/span><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">setColor<\/span><span style=\"line-height: 26px;\">(String&nbsp;color)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5982\u679c\u60f3\u7528\u4e24\u4e2a\u989c\u8272\u600e\u4e48\u529e, \u6211\u4eec\u53ef\u4ee5\u5229\u7528\u65b9\u6cd5\u7684\u91cd\u8f7d, \u5728\u58f0\u660e\u4e00\u4e2a\u65b9\u6cd5:<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u91cd\u8f7d: \u5b58\u5728\u4e8e\u540c\u4e00\u4e2a\u7c7b\u4e2d\uff0c\u6307\u4e00\u4e2a\u65b9\u6cd5\u4e0e\u5df2\u7ecf\u5b58\u5728\u7684\u65b9\u6cd5\u540d\u79f0\u4e0a\u76f8\u540c\uff0c\u4f46\u662f\u53c2\u6570\u7c7b\u578b\u3001\u4e2a\u6570\u3001\u987a\u5e8f\u81f3\u5c11\u6709\u4e00\u4e2a\u4e0d\u540c\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u91cd\u5199\uff1a@Override \u5b58\u5728\u4e8e\u7ee7\u627f\u4f53\u7cfb\u4e2d\uff0c\u6307\u5b50\u7c7b\u5b9e\u73b0\u4e86\u4e00\u4e2a\u4e0e\u7236\u7c7b\u5728\u65b9\u6cd5\u58f0\u660e\u4e0a\u5b8c\u5168\u76f8\u540c\u7684\u4e00\u4e2a\u65b9\u6cd5\u3002<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Apple<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;Sting&nbsp;color;<br  \/>&nbsp;&nbsp;<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5b8c\u6210\u521d\u59cb\u5316<\/span><br  \/>&nbsp;&nbsp;Apple(String&nbsp;color)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u65b9\u6cd51<\/span><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">setColor<\/span><span style=\"line-height: 26px;\">(String&nbsp;color)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u65b9\u6cd52<\/span><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">setColor<\/span><span style=\"line-height: 26px;\">(String&nbsp;color,&nbsp;String&nbsp;color)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u597d\u4e86\u6709\u4e86\u7c7b\uff0c \u5982\u4f55\u4f7f\u7528\u5b83?\u9996\u5148\u8981\u5b9e\u4f8b\u5316:<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5b9e\u4f8b<\/span><br  \/>Apple&nbsp;apple&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;Apple(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"red\"<\/span>);<br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8c03\u7528\u5b9e\u4f8b\u65b9\u6cd5<\/span><br  \/>apple.setColor(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"green\"<\/span>);<br  \/><\/code><\/pre>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u7c7b\u7684\u7ee7\u627f<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u7ee7\u627f\u987e\u540d\u601d\u4e49\uff0c\u7ee7\u627f\u7c7b\u7684\u4e00\u4e9b\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u4e3e\u4e2a\u4f8b\u5b50\uff0c \u8fd8\u662f\u521a\u521a\u7684\u6c34\u679c\u3002java\u4e2d\u4f7f\u7528&nbsp;<span style=\"color:#3eaf7c;\">extends<\/span>&nbsp;:<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6c34\u679c\u7c7b<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Furit<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;Sting&nbsp;color;<br  \/>&nbsp;&nbsp;<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5b8c\u6210\u521d\u59cb\u5316<\/span><br  \/>&nbsp;&nbsp;Apple(String&nbsp;color)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">setColor<\/span><span style=\"line-height: 26px;\">(String&nbsp;color)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/>}<br  \/><br  \/><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u82f9\u679c\u7c7b\uff0c&nbsp;\u7ee7\u627f\u6c34\u679c\u7c7b<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Apple<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">extends<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Furit<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;....<\/span><br  \/>}<br  \/><br  \/><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6a58\u5b50\u7c7b\uff0c&nbsp;\u7ee7\u627f\u6c34\u679c\u7c7b<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Orange<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">extends<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Furit<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;....<\/span><br  \/>}<br  \/><br  \/><br  \/><\/code><\/pre>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">\u65b9\u6cd5\u91cd\u5199<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4f7f\u7528 @Override \u6765\u91cd\u5199\u65b9\u6cd5<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Orange<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">extends<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Furit<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">setColor<\/span><span style=\"line-height: 26px;\">(String&nbsp;color)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.color&nbsp;=&nbsp;color;<br  \/>&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u63a5\u53e3<\/span><\/h3>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u53ef\u4ee5\u770b\u6210\u662f\u5b8c\u5168\u7684\u62bd\u8c61\u7c7b\uff0c java8\u4e4b\u524d \u4e0d\u80fd\u6709\u65b9\u6cd5\u5b9e\u73b0\uff0c java8\u4e4b\u540e\u53ef\u4ee5\u5b9e\u73b0\uff0c \u4e3a\u4e86\u51cf\u5c11\u7ef4\u62a4\u6210\u672c<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u63a5\u53e3\u5185\u90e8\u7684\u6210\u5458 \u9ed8\u8ba4\u90fd\u662fpublic\uff0c \u5e76\u4e14\u4e0d\u5141\u8bb8\u5b9a\u4e49\u4e3a private \u548c protected java9\u4e4b\u540e\u5141\u8bb8\u5b9a\u4e49private<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u63a5\u53e3\u7684\u5b57\u6bb5\u9ed8\u8ba4\u90fd\u662ffinal \u548c static \u7684<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5b9e\u73b0\u63a5\u53e3\u7684\u65b9\u6cd5\u901a\u8fc7 implements \u5173\u952e\u5b57<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u63a5\u53e3\u76f4\u63a5\u4e5f\u53ef\u4ee5\u7ee7\u627f<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u63a5\u53e3\u7684\u597d\u5904: \u4e00\u4e2a\u7c7b\u53ef\u4ee5\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3\uff0c \u4f46\u662f\u4e0d\u80fd\u7ee7\u627f\u591a\u4e2a\u62bd\u8c61\u7c7b, \u63a5\u53e3\u4e3b\u8981\u7528\u4e8e\u7ea6\u675f\u7c7b\u7684\u4e00\u4e9b\u884c\u4e3a\uff0c\u4e3e\u4e2a\u4f8b\u5b50:<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">interface<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Food<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">eat<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>;&nbsp;<br  \/>}<br  \/><br  \/><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">User<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Food<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5fc5\u987b\u5b9e\u73b0\u63a5\u53e3\u7684\u65b9\u6cd5\uff0c\u4e0d\u7136\u4f1a\u62a5\u9519<\/span><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">eat<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;}<br  \/>}<br  \/><br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u63a5\u53e3\u4e4b\u95f4\u4e5f\u6709\u7ee7\u627f:<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">interface<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Food<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">eat<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>;&nbsp;<br  \/>}<br  \/><br  \/><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">interface<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Food<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">extends<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Food<\/span>&nbsp;<\/span>{}<br  \/><br  \/><\/code><\/pre>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u7c7b\u4e2d\u7684\u5173\u952e\u8bcd<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5728\u4e4b\u524d\u7684\u4ecb\u7ecd\u4e2d\u7ecf\u5e38\u4f1a\u770b\u5230 public ,static\u4e4b\u7c7b\u7684\uff0c\u73b0\u5728\u6211\u4eec\u5c31\u4e00\u4e00\u4ecb\u7ecd\u5b83\uff1a<\/p>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">final<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4fee\u9970\u53d8\u91cf\u65f6:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u4f5c\u4e3a\u5e38\u91cf\uff0c \u53ef\u4ee5\u662f\u8fd0\u884c\u65f6\u5e38\u91cf\u4e5f\u53ef\u4f7f\u7f16\u8bd1\u65f6\u5e38\u91cf\uff0c \u4e0d\u53ef\u6539\u53d8<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u4f5c\u4e3a\u5f15\u7528\u5bf9\u8c61\uff0c\u4e0d\u53ef\u4ee5\u4fee\u6539\u5f15\u7528\uff0c \u4f46\u53ef\u4ee5\u4fee\u6539\u672c\u8eab\u7684\u503c<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4fee\u9970\u65b9\u6cd5\u65f6:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u4e0d\u80fd\u591f\u88ab\u91cd\u5199, \u5176\u4e2dprivate\u662f\u9690\u5f0f\u7684final<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4fee\u9970\u7c7b\u65f6:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u4e0d\u80fd\u591f\u88ab\u7ee7\u627f<\/section>\n<\/li>\n<\/ul>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">static<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4fee\u9970\u53d8\u91cf\uff1a<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u6240\u6709\u5b9e\u4f8b\u5171\u4eab\u9759\u6001\u53d8\u91cf \uff0c\u5728\u5185\u5b58\u4e2d\u53ea\u5b58\u4e00\u4efd\uff0c \u53ef\u4ee5\u901a\u8fc7 class.name \u8bbf\u95ee<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5b9e\u4f8b\u53d8\u91cf\uff0c\u6bcf\u521b\u5efa\u4e00\u4e2a\u5b9e\u4f8b\u5c31\u4f1a\u4ea7\u751f\u4e00\u4e2a\u5b9e\u4f8b\u53d8\u91cf\uff0c\u4e0e\u5b9e\u4f8b\u5171\u5b58\u4ea1<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9759\u6001\u65b9\u6cd5:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u9759\u6001\u65b9\u6cd5\u5728\u7c7b\u52a0\u8f7d\u7684\u65f6\u5019\u5c31\u5b58\u5728\u4e86\uff0c\u4e0d\u4f9d\u8d56\u4efb\u4f55\u5b9e\u4f8b\uff0c \u5fc5\u987b\u6709\u5b9e\u73b0 \u4e0d\u80fd\u662f\u62bd\u8c61\u65b9\u6cd5<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5185\u90e8\u65b9\u6cd5\u8bbf\u95ee\u65f6 \u53ea\u53ef\u4ee5\u8bbf\u95eestatic\u4fee\u9970\u7684\u53d8\u91cf\u548c\u65b9\u6cd5\uff0c\u4e0d\u80fd\u6709this super\u5173\u952e\u5b57<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9759\u6001\u8bed\u53e5\u5757:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5728\u7c7b\u52a0\u8f7d\u7684\u65f6\u5019\u503c\u53ea\u8fd0\u884c\u4e00\u6b21<\/section>\n<\/li>\n<\/ul>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/....<\/span><br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9759\u6001\u5185\u90e8\u7c7b: \uff08static \u4e0d\u80fd\u4fee\u9970\u5916\u90e8\u7c7b\uff09<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u9759\u6001\u5185\u90e8\u7c7b\u4e0d\u80fd\u8bbf\u95ee\u5916\u90e8\u7c7b\u975e\u9759\u6001\u6210\u5458<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u521b\u5efa\u4e0d\u9700\u8981\u4f9d\u8d56\u5916\u90e8\u7c7b\u7684\u5b9e\u4f8b\u5316<\/section>\n<\/li>\n<\/ul>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">OuterClass<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">InnerClass<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;x;<br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">get<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;InnerClass.x;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u5185\u90e8\u7c7b\u7684\u6210\u5458<\/span><br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">StaticInnerClass<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;InnerClass&nbsp;innerClass&nbsp;=&nbsp;new&nbsp;InnerClass();&nbsp;\/\/&nbsp;'OuterClass.this'&nbsp;cannot&nbsp;be&nbsp;referenced&nbsp;from&nbsp;a&nbsp;static&nbsp;context<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OuterClass&nbsp;outerClass&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;OuterClass();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InnerClass&nbsp;innerClass&nbsp;=&nbsp;outerClass.<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;InnerClass();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StaticInnerClass&nbsp;staticInnerClass&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;StaticInnerClass();<br  \/>&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9759\u6001\u5bfc\u5305\uff1a\u5728\u4f7f\u7528\u9759\u6001\u53d8\u91cf\u548c\u65b9\u6cd5\u65f6\u4e0d\u7528\u518d\u6307\u660e ClassName\uff0c\u4ece\u800c\u7b80\u5316\u4ee3\u7801\uff0c\u4f46\u53ef\u8bfb\u6027\u5927\u5927\u964d\u4f4e\u3002<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">import<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;com.xxx.ClassName.*<br  \/><\/code><\/pre>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">private<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u8fd9\u4e2a\u4e3b\u8981\u7528\u4e8e\u4fee\u9970\u79c1\u6709\u5c5e\u6027\u548c\u65b9\u6cd5, \u53ea\u80fd\u5728\u672c\u7c7b\u4e2d\u8bbf\u95ee<\/p>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">public<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u516c\u5f00\u6743\u9650, \u8868\u660e\u8be5\u6210\u5458\u53d8\u91cf\u548c\u65b9\u6cd5\u662f\u5171\u6709\u7684\uff0c\u80fd\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\u88ab\u8bbf\u95ee<\/p>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">protected<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5fc5\u987b\u5728\u540c\u4e00\u5305\u4e2d\u624d\u80fd\u88ab\u8bbf\u95ee<\/p>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u7c7b\u7684\u521d\u59cb\u5316\u987a\u5e8f<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9759\u6001\u53d8\u91cf\u548c\u9759\u6001\u8bed\u53e5\u5757\u4f18\u5148\u4e8e\u5b9e\u4f8b\u53d8\u91cf\u548c\u666e\u901a\u8bed\u53e5\u5757\uff0c\u9759\u6001\u53d8\u91cf\u548c\u9759\u6001\u8bed\u53e5\u5757\u7684\u521d\u59cb\u5316\u987a\u5e8f\u53d6\u51b3\u4e8e\u5b83\u4eec\u5728\u4ee3\u7801\u4e2d\u7684\u987a\u5e8f\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u5b58\u5728\u7ee7\u627f\u7684\u60c5\u51b5\u4e0b\uff0c\u521d\u59cb\u5316\u987a\u5e8f\u4e3a\uff1a\u7236\u4f18\u5b50 \u9759\u4f18\u5b9e<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u7236\u7c7b\uff08\u9759\u6001\u53d8\u91cf\u3001\u9759\u6001\u8bed\u53e5\u5757\uff09<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5b50\u7c7b\uff08\u9759\u6001\u53d8\u91cf\u3001\u9759\u6001\u8bed\u53e5\u5757\uff09<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u7236\u7c7b\uff08\u5b9e\u4f8b\u53d8\u91cf\u3001\u666e\u901a\u8bed\u53e5\u5757\uff09<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u7236\u7c7b\uff08\u6784\u9020\u51fd\u6570\uff09<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5b50\u7c7b\uff08\u5b9e\u4f8b\u53d8\u91cf\u3001\u666e\u901a\u8bed\u53e5\u5757\uff09<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u5b50\u7c7b\uff08\u6784\u9020\u51fd\u6570\uff09<\/section>\n<\/li>\n<\/ul>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u5bf9\u8c61\u7684\u901a\u7528\u65b9\u6cd5<\/span><\/h3>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;native&nbsp;int&nbsp;hashCode()<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;boolean&nbsp;equals(Object&nbsp;obj)<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;native&nbsp;Object&nbsp;clone()&nbsp;throws&nbsp;CloneNotSupportedException<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;String&nbsp;toString()<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;final&nbsp;native&nbsp;Class&lt;?&gt;&nbsp;getClass()<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;void&nbsp;finalize()&nbsp;throws&nbsp;Throwable&nbsp;{}<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;final&nbsp;native&nbsp;void&nbsp;notify()<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;final&nbsp;native&nbsp;void&nbsp;notifyAll()<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;final&nbsp;native&nbsp;void&nbsp;wait(long&nbsp;timeout)&nbsp;throws&nbsp;InterruptedException<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;final&nbsp;void&nbsp;wait(long&nbsp;timeout,&nbsp;int&nbsp;nanos)&nbsp;throws&nbsp;InterruptedException<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;final&nbsp;void&nbsp;wait()&nbsp;throws&nbsp;InterruptedException<\/span><br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u6211\u4eec\u4ecb\u7ecd\u5e38\u7528\u7684\u51e0\u4e2a:<\/p>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">equals \u7528\u4e8e\u5224\u65ad\u7b49\u4ef7\u5173\u7cfb<\/h4>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u4efb\u4f55\u975enull\u7684\u5bf9\u8c61\u4e0enull \u6bd4\u8f83\u90fd\u4e3a false<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u57fa\u672c\u7c7b\u578b\uff1a== \u5224\u65ad\u503c , \u6ca1\u6709equals\u65b9\u6cd5<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u5f15\u7528\u7c7b\u578b: == \u5224\u65ad\u4e24\u4e2a\u53d8\u91cf\u662f\u5426\u5f15\u7528\u540c\u4e00\u4e2a\u5bf9\u8c61 , equals\u5224\u65ad\u5f15\u7528\u7684\u5bf9\u8c61\u662f\u5426\u7b49\u4ef7<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"1\"<\/span>.equals(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>));&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"---------&gt;\"<\/span>);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Integer&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Integer&nbsp;b&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Integer&nbsp;c&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;Integer(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>);<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.info(a.equals(b));&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true&nbsp;1&nbsp;==&nbsp;1<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.info(a&nbsp;==&nbsp;b);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true&nbsp;&nbsp;\u5f15\u7528\u7684\u662f\u540c\u4e00\u4e2a\u5bf9\u8c61,&nbsp;\u539f\u56e0\u662fInteger\u7f13\u51b2\u6c60<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.info(a&nbsp;==&nbsp;c);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;false&nbsp;new&nbsp;\u5173\u952e\u8bcd\u751f\u6210\u7684\u65b0\u5bf9\u8c61\u6240\u4ee5\u5f15\u7528\u4e0d\u540c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.info(a.equals(c));&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;true&nbsp;&nbsp;\u4ed6\u4eec\u5f15\u7528\u7684\u5bf9\u8c61\u503c\u90fd\u662f1&nbsp;\u6240\u4ee5\u76f8\u7b49<\/span><br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u624b\u52a8\u5b9e\u73b0\u4e00\u4e2aequals,\u5728\u8986\u76d6 equals() \u65b9\u6cd5\u65f6\u5e94\u5f53\u603b\u662f\u8986\u76d6 hashCode() \u65b9\u6cd5\uff0c\u4fdd\u8bc1\u7b49\u4ef7\u7684\u4e24\u4e2a\u5bf9\u8c61\u54c8\u5e0c\u503c\u4e5f\u76f8\u7b49<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u5224\u65ad\u662f\u5426\u5f15\u7528\u540c\u4e00\u4e2a\u5bf9\u8c61 \u662f -&gt; true<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u5224\u65ad\u7c7b\u578b\uff1anull -&gt; false \u7c7b\u578b\u4e0d\u540c -&gt; false<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u5224\u65ad\u503c\u662f\u5426\u76f8\u540c: \u4e0d\u540c -&gt; false<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Override<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hashCode<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;result&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">17<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">31<\/span>&nbsp;*&nbsp;result&nbsp;+&nbsp;x;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">31<\/span>&nbsp;*&nbsp;result&nbsp;+&nbsp;y;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">31<\/span>&nbsp;*&nbsp;result&nbsp;+&nbsp;z;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;result;<br  \/>}<br  \/><br  \/><span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Override<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">boolean<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">equals<\/span><span style=\"line-height: 26px;\">(Object&nbsp;o)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>&nbsp;(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>&nbsp;==&nbsp;o)&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">true<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>&nbsp;(o&nbsp;==&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>&nbsp;||&nbsp;getClass()&nbsp;!=&nbsp;o.getClass())&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">false<\/span>;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;ObjectMain&nbsp;that&nbsp;=&nbsp;(ObjectMain)&nbsp;o;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>&nbsp;(x&nbsp;!=&nbsp;that.x)&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">false<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">if<\/span>&nbsp;(y&nbsp;!=&nbsp;that.y)&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">false<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;z&nbsp;==&nbsp;that.z;<br  \/>}<br  \/><br  \/><\/code><\/pre>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">toString()<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u9ed8\u8ba4\u8fd4\u56de ToStringExample@4554617c \u8fd9\u79cd\u5f62\u5f0f\uff0c\u5176\u4e2d @ \u540e\u9762\u7684\u6570\u503c\u4e3a\u6563\u5217\u7801\u7684\u65e0\u7b26\u53f7\u5341\u516d\u8fdb\u5236\u8868\u793a<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"1\"<\/span>.toString());<br  \/>}<br  \/><\/code><\/pre>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">clone<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">\u4e0d\u63a8\u8350\u4f7f\u7528 clone\u65b9\u6cd5\u6765\u5b9e\u73b0\u5bf9\u8c61\u7684\u62f7\u8d1d, \u5efa\u8bae\u4f7f\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\u6216\u8005\u5de5\u5382\u6a21\u5f0f<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u6d45\u62f7\u8d1d\uff1a\u5f15\u7528\u7684\u540c\u4e00\u4e2a\u5bf9\u8c61<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u6df1\u62f7\u8d1d\uff1a\u5f15\u7528\u7684\u5bf9\u8c61\u4e0d\u540c<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u62f7\u8d1d\u7684\u5b9e\u73b0<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;CloneExample&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;CloneExample();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;CloneExample&nbsp;b&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;CloneExample(a);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;a.set(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"c\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Log.info(b.get());&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;a&nbsp;\u8bf4\u660e\u662f\u4e24\u4e2a\u4e0d\u540c\u7684\u5bf9\u8c61<\/span><br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">CloneExample<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;String&nbsp;a;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;CloneExample()&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.a&nbsp;=&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"a\"<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;CloneExample(CloneExample&nbsp;e)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.a&nbsp;=&nbsp;e.a;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">set<\/span><span style=\"line-height: 26px;\">(String&nbsp;n)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.a&nbsp;=&nbsp;n;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;String&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">get<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.a;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><br  \/><\/code><\/pre>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u62bd\u8c61\u7c7b<\/span><\/h3>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u4e0d\u80fd\u5b9e\u4f8b\u5316 \u53ea\u80fd\u7ee7\u627f<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;color: black;margin-top: 10px;margin-bottom: 10px;word-spacing: 2px;\">\u5982\u679c\u4e00\u4e2a\u7c7b\u4e2d\u5b58\u5728\u62bd\u8c61\u65b9\u6cd5\u90a3\u4e48 \u8fd9\u4e2a\u7c7b\u5fc5\u987b\u662f\u62bd\u8c61\u7c7b, \u5b9a\u4e49\u62bd\u8c61\u65b9\u6cd5\u4e0d\u8981\u5b9e\u73b0<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">abstract<\/span>&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Cat<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">abstract<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">getName<\/span><span style=\"line-height: 26px;\">()<\/span><\/span>;<br  \/>}<br  \/><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">class<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Animal<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">extends<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">Cat<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5fc5\u987b\u5b9e\u73b0\u65b9\u6cd5<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">@Override<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">void<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">getName<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<br  \/><\/code><\/pre>\n<h3 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;text-align: center;\"><span style=\"border-bottom-width: 2px;border-bottom-style: solid;border-bottom-color: rgb(216, 156, 246);\">\u5f02\u5e38\u7c7b Exception<\/span><\/h3>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">Error:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">\u865a\u62df\u673a\u62a5\u9519 VirtualMachineError<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">StackOverFlowError<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">OutOfMemoryError<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">AWTError<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">Exception:<\/p>\n<ul style=\"margin-top: 8px;margin-bottom: 8px;padding-left: 25px;font-size: 15px;list-style-type: circle;\" class=\"list-paddingleft-2\">\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">IOException<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">EOFException<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px;margin-bottom: 5px;line-height: 26px;color: rgb(1, 1, 1);font-size: 14px;\">...<\/section>\n<\/li>\n<\/ul>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">RuntimeException<\/p>\n<h4 style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 18px;\">\u5f02\u5e38\u6355\u83b7<\/h4>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\">java\u4e2d\u4f7f\u7528&nbsp;<span style=\"color:#3eaf7c;\">try catch<\/span>&nbsp;\u6355\u83b7\u5f02\u5e38, finally \u7528\u4e8e\u7a0b\u5e8f\u6062\u590d<\/p>\n<pre style=\"margin-top: 10px;margin-bottom: 10px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;\"><span style=\"display: block;background-image: url('https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434883.jpeg');height: 30px;width: 749px;background-size: 40px;background-color: rgb(40, 44, 52);margin-bottom: -7px;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;background-position: 10px 10px;background-repeat: no-repeat no-repeat;\"><\/span><code style=\"overflow-x: auto;padding: 15px 16px 16px;color: rgb(171, 178, 191);display: -webkit-box;font-family: &quot;Operator Mono&quot;, Consolas, Monaco, Menlo, monospace;font-size: 12px;background-color: rgb(40, 44, 52);border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;\">&nbsp;<span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">static<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">main<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">0<\/span>;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">try<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">1<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">throw<\/span>&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;Exception(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u62a5\u9519\u4e86\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u5728\u6ca1\u6709\u5f02\u5e38\u7684\u60c5\u51b5\u4e0b&nbsp;\uff0c\u8fd4\u56de\u503c\u7b49\u4e8e&nbsp;try\u5185\u90e8\u7684\u8fd4\u56de\u503c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;return&nbsp;a;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">catch<\/span>&nbsp;(Exception&nbsp;e)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(e.getMessage());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">2<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;a;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">finally<\/span>&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">3<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"final\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;a;<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/return&nbsp;a;<\/span><br  \/>}<br  \/><\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 26px;margin-top: 10px;margin-bottom: 10px;font-size: 14px;word-spacing: 2px;\"><span style=\"color: rgb(145, 109, 213);\">\u597d\u4e86\uff0c\u5b9d\u513f\uff0c\u6211\u89c9\u5f97\u4f60\u5b66\u4f1a\u4e86<\/span><\/p>\n<figure style=\"margin-top: 10px;margin-bottom: 10px;display: flex;flex-direction: column;justify-content: center;align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"900\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042438854.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\"  \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1\"  data-type=\"jpeg\" data-w=\"900\" style=\"border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-right-radius: 6px;border-bottom-left-radius: 6px;display: block;margin: 20px auto;object-fit: contain;box-shadow: rgb(153, 153, 153) 2px 4px 7px;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042438854.jpeg\"  \/><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u4e0d\u8981\u4f60\u89c9\u5f97<\/figcaption><\/figure>\n<p><\/imgbox><\/section>\n<p><br  \/><\/p>\n<blockquote>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7:                 \u7a0b\u5e8f\u5458\u76ae\u5361\u79cb              <\/p>\n<\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u672c\u7ae0\u8282\u4e3b\u8981\u8bb2\u8ff0java\u7684\u4e00\u4e9b\u57fa\u7840\u8bed\u6cd5\uff0c\u6bd4\u5982\u5e38\u89c1\u7684\u6570\u636e\u7c7b\u578b\uff0c\u6d41\u7a0b\u63a7\u5236\u8bed\u53e5\uff0c\u7c7b\u7684\u4e00\u4e9b\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u5e2e\u52a9\u5927\u5bb6\u7406\u89e3\u548c\u5feb\u901f\u5165\u95e8\u3002\u5982\u679c\u4f60\u5df2 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1373,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-1377","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434273-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042436299.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434273-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434273.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042436299.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434273-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434273.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042434273.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042436299.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042436299.jpeg","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042437183.jpeg","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042437183.jpeg","id":"image3"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042438854.jpeg","id":"image4"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042438854.jpeg","id":"image5"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"Java","post_date":"2023-06-27","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":302,"next_post_id":2339,"next_post_title":"Java\u6cdb\u578b\u4e2d\u7684T\u3001E\u3001K\u3001V\u3001\uff1f\u901a\u914d\u7b26\uff0c\u4f60\u786e\u5b9a\u90fd\u4e86\u89e3\u5417\uff1f","previous_post_id":1284,"previous_post_title":"\u9762\u8bd5\u5b98: \u6709\u4e86\u89e3\u8fc7volatile\u5173\u952e\u5b57\u5417 \u8bf4\u8bf4\u770b","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1377"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1377\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1373"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}