{"id":1385,"date":"2023-06-27T13:54:39","date_gmt":"2023-06-27T05:54:39","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=1385"},"modified":"2023-06-27T13:54:39","modified_gmt":"2023-06-27T05:54:39","slug":"%e8%8a%b1%e5%87%a0%e5%88%86%e9%92%9f%e5%bf%ab%e9%80%9f%e4%ba%86%e8%a7%a3%e4%b8%80%e4%b8%8b%e6%b3%9b%e5%9e%8b%e4%b8%8e%e6%9e%9a%e4%b8%be%ef%bc%88%e6%9c%89%e6%89%8b%e5%b0%b1%e4%bc%9a%ef%bc%89","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/java\/%e8%8a%b1%e5%87%a0%e5%88%86%e9%92%9f%e5%bf%ab%e9%80%9f%e4%ba%86%e8%a7%a3%e4%b8%80%e4%b8%8b%e6%b3%9b%e5%9e%8b%e4%b8%8e%e6%9e%9a%e4%b8%be%ef%bc%88%e6%9c%89%e6%89%8b%e5%b0%b1%e4%bc%9a%ef%bc%89\/","title":{"rendered":"\u82b1\u51e0\u5206\u949f\u5feb\u901f\u4e86\u89e3\u4e00\u4e0b\u6cdb\u578b\u4e0e\u679a\u4e3e\uff08\u6709\u624b\u5c31\u4f1a\uff09"},"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;\">\n<h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px;margin-bottom: 15px;font-weight: bold;font-size: 25px;\"><span style=\"display: inline-block;color: rgb(119, 48, 152);\">Java\u679a\u4e3e\u4e0e\u6cdb\u578b<\/span><\/h1>\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\u8282\u7ed9\u5927\u5bb6\u8bb2\u8bb2&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u679a\u4e3e\u4e0e\u6cdb\u578b<\/span>\u300d<\/strong>&nbsp;\uff0c\u672c\u7bc7\u5185\u5bb9\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206:<\/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;\">\u679a\u4e3e\u5b9a\u4e49\u548c\u4f7f\u7528<\/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;\">\u6cdb\u578b\u8bb2\u89e3<\/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;\">\u4ee3\u7801\u5b9e\u64cd<\/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;\">\u5e38\u89c1\u7684\u6cdb\u578b\u95ee\u9898<\/section>\n<\/li>\n<\/ul>\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);\">\u679a\u4e3e<\/span><\/h2>\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);\">\u5b9a\u4e49<\/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;\">\u5565\u662f\u679a\u4e3e?\u4ece\u5b9a\u4e49\u6765\u8bb2\u679a\u4e3e\u5c31\u662f\u60c5\u51b5\u7684\u5404\u79cd\u7f57\u5217\uff0c\u5728java\u4e2d\u5b83\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u7c7b\uff0c\u4e00\u822c\u8868\u793a\u4e00\u7ec4\u5e38\u91cf\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\/20230528042541369.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;\">enum<\/span>&nbsp;Color&nbsp;<br  \/>{&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;RED,&nbsp;BLUE;&nbsp;<br  \/>}&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;\">\u4e0a\u8ff0\u4ee3\u7801\uff0c\u679a\u4e3e\u4e86\u989c\u8272\u7684\u4e24\u79cd\u6210\u5458\uff0c\u5206\u522b\u662f&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;\">RED, BLUE<\/code>\uff0c\u679a\u4e3e\u4e5f\u53ef\u4ee5\u5b9a\u4e49\u5728\u7c7b\u4e2d\uff0c\u6211\u4eec\u8f93\u51fa\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\/20230528042541369.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;\">EnumTest<\/span><br  \/><\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">enum<\/span>&nbsp;Color<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RED,&nbsp;GREEN,&nbsp;BLUE;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6267\u884c\u8f93\u51fa\u7ed3\u679c<\/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;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;c&nbsp;=&nbsp;Color.RED;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(c);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;RED<\/span><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;\">\u7ed3\u679c\u8fd4\u56de&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;\">RED<\/code><\/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);\">\u904d\u5386\u679a\u4e3e<\/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;\">\u5982\u4f55\u53bb\u904d\u5386\u5b83\u7684\u6210\u5458\u5462\uff1f<\/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\/20230528042541369.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;\">EnumTest<\/span><br  \/><\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">enum<\/span>&nbsp;Color<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RED,&nbsp;GREEN,&nbsp;BLUE;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6267\u884c\u8f93\u51fa\u7ed3\u679c<\/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;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">for<\/span>&nbsp;(Color&nbsp;c&nbsp;:&nbsp;Color.values())&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(c);<br  \/>&nbsp;&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;RED<\/span><br  \/>&nbsp;&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;GREEN<\/span><br  \/>&nbsp;&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;BLUE<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<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);\">\u4f5c\u4e3a\u6761\u4ef6\u4f7f\u7528<\/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\u4e5f\u53ef\u4ee5\u7528\u4f5c\u6761\u4ef6\u4f7f\u7528\uff0c\u8fd9\u6837\u4ee3\u7801\u53ef\u8bfb\u6027\u4f1a\u53d8\u9ad8\u4e00\u70b9<\/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\/20230528042541369.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;\">EnumTest<\/span><br  \/><\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">enum<\/span>&nbsp;Color<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RED,&nbsp;GREEN,&nbsp;BLUE;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6267\u884c\u8f93\u51fa\u7ed3\u679c<\/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;\">main<\/span><span style=\"line-height: 26px;\">(String[]&nbsp;args)<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Color&nbsp;c&nbsp;=&nbsp;Color.BLUE;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">switch<\/span>(c)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">case<\/span>&nbsp;RED:<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u7ea2\u8272\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">break<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">case<\/span>&nbsp;GREEN:<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u7eff\u8272\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">break<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">case<\/span>&nbsp;BLUE:<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u84dd\u8272\"<\/span>);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">break<\/span>;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>}<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);\">\u8fdb\u9636\u7528\u6cd5<\/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;\">\u4e3e\u4e00\u4e2a\u5e38\u7528\u7684\u4f8b\u5b50\uff0c\u6211\u4eec\u5728\u505aAPI\u8bf7\u6c42\u8fd4\u56de\u54cd\u5e94\u7ed3\u679c\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u679a\u4e3e\u53bb\u5b9a\u4e49\u6211\u4eec\u7684\u54cd\u5e94\u4f53\uff0c\u6839\u636e\u4e0d\u540c\u7684\u53d8\u91cf\uff0c\u8fd4\u56de\u54cd\u5e94\u7684\u7ed3\u679c\u3002\u6765\u770b\u4e00\u4e2a\u6211\u5199\u597d\u7684\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\/20230528042541369.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=\"color: rgb(198, 120, 221);line-height: 26px;\">enum<\/span>&nbsp;Response&nbsp;implements&nbsp;ResponseInter&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;SUCCESS(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">200<\/span>,&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>,&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"success\"<\/span>),<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Fail(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">0<\/span>,&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>,&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u9519\u8bef\"<\/span>),<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Response(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">0<\/span>,&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">null<\/span>,&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\"<\/span>);<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;String&nbsp;msg;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;Integer&nbsp;code;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;Object&nbsp;data;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;Response(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;code,&nbsp;String&nbsp;data,&nbsp;String&nbsp;msg)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.code&nbsp;=&nbsp;code;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.msg&nbsp;=&nbsp;msg;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.data&nbsp;=&nbsp;data;<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;\">getMsg<\/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;msg;<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;\">setMsg<\/span><span style=\"line-height: 26px;\">(String&nbsp;msg)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.msg&nbsp;=&nbsp;msg;<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;Integer&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">getCode<\/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;code;<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;\">setCode<\/span><span style=\"line-height: 26px;\">(Integer&nbsp;code)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.code&nbsp;=&nbsp;code;<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;Object&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">getData<\/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;data;<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;\">setData<\/span><span style=\"line-height: 26px;\">(Object&nbsp;data)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.data&nbsp;=&nbsp;data;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><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;ResponseData&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">response<\/span><span style=\"line-height: 26px;\">(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;code,&nbsp;String&nbsp;data,&nbsp;String&nbsp;msg)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.code&nbsp;=&nbsp;code;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.msg&nbsp;=&nbsp;msg;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.data&nbsp;=&nbsp;data;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;getResponse();<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;\">private<\/span>&nbsp;ResponseData&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">getResponse<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResponseData&nbsp;response&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;ResponseData();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.setData(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.data);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.setCode(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.code);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response.setMsg(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">this<\/span>.msg);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;response;<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;ResponseData&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">success<\/span><span style=\"line-height: 26px;\">()<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;getResponse();<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;ResponseData&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">fail<\/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;getResponse();<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<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;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u679a\u4e3e\u4e5f\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u7c7b<\/span>\u300d<\/strong>&nbsp;,\u6240\u4ee5\u5b83\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u63a5\u53e3\u3002\u5f53\u6211\u4eec\u5b9a\u4e49<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;\">SUCCESS(200, null, \"success\")<\/code>\u8fd9\u79cd\u5e26\u62ec\u53f7\u7684\u6210\u5458\u65f6\uff0c<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;\">idea<\/code>\u4f1a\u81ea\u52a8\u63d0\u793a\u4f60\u53bb\u521b\u5efa\u5b83\u7684\u6784\u9020\u51fd\u6570\uff0c\u6240\u4ee5\u540e\u8fb9\u6211\u4eec\u53ef\u4ee5\u53d6\u5b9e\u4f8b\u5316\u5b83\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\/20230528042541369.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(97, 174, 238);line-height: 26px;\">@FunctionalInterface<\/span>&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u51fd\u6570\u5f0f\u63a5\u53e3<\/span><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;\">ResponseInter<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">ResponseData&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">response<\/span><span style=\"line-height: 26px;\">(<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">int<\/span>&nbsp;code,&nbsp;String&nbsp;data,&nbsp;String&nbsp;msg)<\/span><\/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;\">\u8fd9\u91cc\u63d2\u4e00\u4e2a\u5c0f\u77e5\u8bc6\u70b9\uff0c<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;\">@FunctionalInterface<\/code>&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c<span style=\"color:#3eaf7c;\">\u8868\u793a\u51fd\u6570\u5f0f\u63a5\u53e3<\/span>\u300d<\/strong>, \u6210\u5458\u5185\u90e8\u53ea\u80fd\u6709\u4e00\u4e2a\u63a5\u53e3\u65b9\u6cd5\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;\">\u5982\u4f55\u4f7f\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\/20230528042541369.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;\">EnumMain<\/span>&nbsp;<\/span>{<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;\">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;&nbsp;&nbsp;Response&nbsp;response&nbsp;=&nbsp;Response.SUCCESS;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;res&nbsp;=&nbsp;JSON.toJSONString(response.success());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(res);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;{\"code\":200,\"msg\":\"success\"}<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response&nbsp;response1&nbsp;=&nbsp;Response.Fail;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;res1&nbsp;=&nbsp;JSON.toJSONString(response1.fail());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(res1);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/{\"code\":0,\"msg\":\"\u9519\u8bef\"}<\/span><br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response&nbsp;response2&nbsp;=&nbsp;Response.Response;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;res2&nbsp;=&nbsp;JSON.toJSONString(response2.response(<span style=\"color: rgb(209, 154, 102);line-height: 26px;\">200<\/span>,&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u8fd9\u662f\u6570\u636e\"<\/span>,&nbsp;<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"success\"<\/span>));<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(res2);&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;{\"code\":200,\"data\":\"\u8fd9\u662f\u6570\u636e\",\"msg\":\"success\"}<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<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;\">\u662f\u4e0d\u662f\u5f88\u7b80\u5355\uff0c\u8fd9\u91cc\u6211\u53ea\u662f\u7c97\u7565\u7684\u5b9a\u4e49\u4e86\u4e00\u4e0b\uff0c\u5176\u5b9e\u8fd8\u53ef\u4ee5\u7ee7\u7eed\u6df1\u5165\u4e0b\u53bb\uff0c\u6bd4\u5982\u6211\u4eec\u5b9a\u4e49\u5404\u79cd\u60c5\u51b5\u4e0b\u8bf7\u6c42\u7684\u72b6\u6001\u7801\uff0c\u8fd9\u6837\u4e00\u6765\uff0c\u5c31\u4e0d\u7528\u6211\u4eec\u6bcf\u6b21\u624b\u52a8\u586b\u5199\u5177\u4f53\u7684\u503c\u4e86\u3002<\/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);\">\u6cdb\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;\">\u4ece\u5b57\u9762\u610f\u601d\u8bb2\uff0c\u4e0d\u786e\u5b9a\u7684\u7c7b\u578b\u3002\u6709\u65f6\u5019\u6211\u4eec\u5728\u5199\u4ee3\u7801\u65f6\uff0c\u4f20\u53c2\u90fd\u9700\u8981\u5b9a\u4e49\u5177\u4f53\u7684\u7c7b\u578b\uff0c\u4e0d\u7136\u7f16\u8bd1\u4f1a\u62a5\u9519\uff0c\u4f46\u662f\u6709\u4e9b\u60c5\u51b5\u6211\u4eec\u9700\u8981\u590d\u7528\u6211\u4eec\u7684\u4ee3\u7801\uff0c\u4f46\u662f\u7531\u4e8e\u5f3a\u7c7b\u578b\u7684\u8981\u6c42\u4e0b\uff0c\u6211\u4eec\u4e0d\u5f97\u5df2\u53bb\u5728\u5b9a\u4e49\u8fd9\u6837\u7684\u7c7b\uff0c\u8fd9\u6837\u663e\u5f97\u5f88\u9ebb\u70e6\uff0c\u6240\u4ee5\u8fd9\u65f6\u5019\u6cdb\u578b\uff0c\u5c31\u6709\u5f88\u5927\u7684\u4f5c\u7528\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);\">\u5b9a\u4e49<\/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;\">\u5148\u770b\u6700\u7b80\u5355\u7684\u4e00\u4e2a\u4f8b\u5b50\u4f53\u4f1a\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\/20230528042541369.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(97, 174, 238);line-height: 26px;\">@Data<\/span><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;\">ClassMain<\/span>&nbsp;&lt;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">T<\/span>&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;T&nbsp;name;<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;\"><strong style=\"color: rgb(145, 109, 213);\">\u300c\u6cdb\u578b\u7c7b\u300d<\/strong>&nbsp;\u578b\u5728\u903b\u8f91\u4e0a\u770b\u4ee5\u770b\u6210\u662f\u591a\u4e2a\u4e0d\u540c\u7684\u7c7b\u578b\uff0c\u5b9e\u9645\u4e0a\u90fd\u662f\u76f8\u540c\u7684\u57fa\u672c\u7c7b\u578b\u3002\u901a\u5e38\u4f7f\u7528T\u6765\u4ee3\u8868\u67d0\u79cd\u7c7b\u578b\uff0c T\u4e0d\u662f\u7edd\u5bf9\u7684\uff0c\u53ef\u4ee5\u662f\u4efb\u610f\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;\">\u5982\u4f55\u4f7f\u7528, \u7c7b\u540d&lt;\u7c7b\u578b&gt;:<\/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\/20230528042541369.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;\">ClassMain&lt;String&gt;&nbsp;f&nbsp;=&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">new<\/span>&nbsp;ClassMain&lt;&gt;();<br  \/>f.setName(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"haha\"<\/span>);<br  \/>Log.info(f.getName().getClass());&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;class&nbsp;java.lang.String<\/span><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);\">\u6cdb\u578b\u63a5\u53e3<\/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;\">\u6cdb\u578b\u63a5\u53e3\u4f7f\u7528\u8fd8\u662f\u6bd4\u8f83\u591a\u7684\uff0c\u770b\u4e00\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\/20230528042541369.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;\">InterfaceMain<\/span>&lt;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">T<\/span>&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"line-height: 26px;\">T&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hello<\/span><span style=\"line-height: 26px;\">(ClassMain&lt;T&gt;&nbsp;...obj)<\/span><\/span>;<br  \/>}<br  \/><\/code><\/pre>\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\/20230528042541369.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(97, 174, 238);line-height: 26px;\">@Data<\/span><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;\">ClassMain<\/span>&nbsp;&lt;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">T<\/span>&gt;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">implements<\/span>&nbsp;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">InterfaceMain<\/span>&nbsp;&lt;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">T<\/span>&gt;&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;T&nbsp;name;<br  \/><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;T&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hello<\/span><span style=\"line-height: 26px;\">(ClassMain&lt;T&gt;&nbsp;...obj)<\/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>.name;<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;\"><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;\">...obj<\/code>\u8fd9\u4e2a\u8868\u793a\u4e0d\u5b9a\u53c2\u6570\uff0c\u610f\u601d\u662f\u8bf4\u4f60\u53ef\u4ee5\u4f20\u591a\u4e2a\u540c\u7c7b\u578b\u7684\u53c2\u6570\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);\">\u6cdb\u578b\u901a\u914d\u7b26<\/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;\">\u6709\u65f6\u5019\u4f60\u5728\u4f7f\u7528\u522b\u4eba\u5199\u597d\u7684\u7c7b\u65f6\uff0c\u7ecf\u5e38\u770b\u5230<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;\">\uff1f<\/code>\u8fd9\u6837\u7684\u6807\u8bb0, \u5b83\u8868\u793a\u4e00\u4e9b\u4e0d\u786e\u5b9a\u7684\u7c7b\u578b\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\/20230528042541369.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;\u6cdb\u578b\u901a\u914d\u7b26<\/span><br  \/><span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u9002\u5408\u4e00\u4e9b\u4e0d\u786e\u5b9a\u7684\u7c7b\u578b<\/span><br  \/><span style=\"line-height: 26px;\"><span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;T&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hello1<\/span><span style=\"line-height: 26px;\">(ClassMain&lt;?&gt;&nbsp;obj)<\/span>&nbsp;<\/span>{<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;\">this<\/span>.name;<br  \/>}<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);\">\u6cdb\u578b\u65b9\u6cd5<\/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\u8fc7\u4e00\u4e2a\u4f8b\u5b50\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\/20230528042541369.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;\">MethodMain<\/span>&nbsp;&lt;<span style=\"color: rgb(230, 192, 123);line-height: 26px;\">T<\/span>&gt;&nbsp;<\/span>{<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">private<\/span>&nbsp;T&nbsp;name;<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;&lt;T&gt;&nbsp;<span style=\"line-height: 26px;\">T&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">hello<\/span><span style=\"line-height: 26px;\">(MethodMain&lt;T&gt;&nbsp;obj)<\/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;obj.getMsg(obj.name);<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;T&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">getMsg<\/span><span style=\"line-height: 26px;\">(T&nbsp;name)<\/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;name;<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">public<\/span>&nbsp;&lt;T&gt;&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;\">getMsg<\/span><span style=\"line-height: 26px;\">(T&nbsp;...arg)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">for<\/span>(T&nbsp;args&nbsp;:arg)&nbsp;{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(<span style=\"color: rgb(152, 195, 121);line-height: 26px;\">\"\u6cdb\u578b\u53ef\u53d8\u53c2&nbsp;---&gt;\"<\/span>&nbsp;+&nbsp;args);<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u9759\u6001\u65b9\u6cd5\u4f7f\u7528\u6cdb\u578b\u65f6\uff0c\u9700\u8981\u5b9a\u4e49\u6210\u6cdb\u578b\u65b9\u6cd5,&nbsp;\u5e76\u4e14\u4e0e\u5b9a\u4e49\u7c7b\u65e0\u5173<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<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;&lt;T&gt;&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;\">get1<\/span><span style=\"line-height: 26px;\">(T&nbsp;...arg)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(arg.getClass().getName());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<br  \/><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u6cdb\u578b\u4e2d\u7684\u8fb9\u754c<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;extends&nbsp;\u7ee7\u627f&nbsp;String&nbsp;\u7c7b\u578b<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/&nbsp;\u8fd8\u6709\u4e00\u4e2a\u662f&nbsp;super&nbsp;\u53cd\u4e4b<\/span><br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<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;&lt;T&nbsp;extends&nbsp;String&gt;&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;\">get2<\/span><span style=\"line-height: 26px;\">(T&nbsp;...arg)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.info(arg.getClass().getName());<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;}<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;\"><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;\">&lt;T extends String&gt;<\/code>\u8fd9\u79cd\u901a\u5e38\u53eb&nbsp;<strong style=\"color: rgb(145, 109, 213);\">\u300c\u6cdb\u578b\u8fb9\u754c\u300d<\/strong>, \u5e38\u7528\u6765\u7ea6\u675f\u6211\u4eec\u7684\u6cdb\u578b\uff0c\u4f7f\u5b83\u4e25\u8c28\u4e00\u4e9b\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);\">\u6cdb\u578b\u4e00\u95ee\u4e00\u7b54\u2753<\/span><\/h3>\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;\">Java\u4e2d\u7684\u6cdb\u578b\u662f\u4ec0\u4e48 ? \u4f7f\u7528\u6cdb\u578b\u7684\u597d\u5904\u662f\u4ec0\u4e48?<\/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;\">\u6cdb\u578b\u9632\u6b62\u4e86\u90a3\u79cd\u60c5\u51b5\u7684\u53d1\u751f,\u5b83\u63d0\u4f9b\u4e86\u7f16\u8bd1\u671f\u7684\u7c7b\u578b\u5b89\u5168\uff0c\u786e\u4fdd\u4f60\u53ea\u80fd\u628a\u6b63\u786e\u7c7b\u578b\u7684\u5bf9\u8c61\u653e\u5165\u96c6\u5408\u4e2d\uff0c\u907f\u514d\u4e86\u5728\u8fd0\u884c\u65f6\u51fa\u73b0<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;\">ClassCastException<\/code>\u3002<\/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;\">Java\u7684\u6cdb\u578b\u662f\u5982\u4f55\u5de5\u4f5c\u7684 ? \u4ec0\u4e48\u662f\u7c7b\u578b\u64e6\u9664 ?<\/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;\">\u6cdb\u578b\u662f\u901a\u8fc7\u7c7b\u578b\u64e6\u9664\u6765\u5b9e\u73b0\u7684\uff0c\u7f16\u8bd1\u5668\u5728\u7f16\u8bd1\u65f6\u64e6\u9664\u4e86\u6240\u6709\u7c7b\u578b\u76f8\u5173\u7684\u4fe1\u606f\uff0c\u6240\u4ee5\u5728\u8fd0\u884c\u65f6\u4e0d\u5b58\u5728\u4efb\u4f55\u7c7b\u578b\u76f8\u5173\u7684\u4fe1\u606f\u3002<\/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;\">\u4ec0\u4e48\u662f\u6cdb\u578b\u4e2d\u7684\u9650\u5b9a\u901a\u914d\u7b26\u548c\u975e\u9650\u5b9a\u901a\u914d\u7b26 ?<\/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;\">\u9650\u5b9a\u901a\u914d\u7b26\u5bf9\u7c7b\u578b\u8fdb\u884c\u4e86\u9650\u5236\u3002\u6709\u4e24\u79cd\u9650\u5b9a\u901a\u914d\u7b26\uff0c\u4e00\u79cd\u662f<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;\">&lt;? extends T&gt;<\/code>\u5b83\u901a\u8fc7\u786e\u4fdd\u7c7b\u578b\u5fc5\u987b\u662fT\u7684\u5b50\u7c7b\u6765\u8bbe\u5b9a\u7c7b\u578b\u7684\u4e0a\u754c\uff0c\u53e6\u4e00\u79cd\u662f<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;\">&lt;? super T&gt;<\/code>\u5b83\u901a\u8fc7\u786e\u4fdd\u7c7b\u578b\u5fc5\u987b\u662fT\u7684\u7236\u7c7b\u6765\u8bbe\u5b9a\u7c7b\u578b\u7684\u4e0b\u754c\u3002\u6cdb\u578b\u7c7b\u578b\u5fc5\u987b\u7528\u9650\u5b9a\u5185\u7684\u7c7b\u578b\u6765\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u5426\u5219\u4f1a\u5bfc\u81f4\u7f16\u8bd1\u9519\u8bef\u3002\u53e6\u4e00\u65b9\u9762<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;\">&lt;?&gt;<\/code>\u8868\u793a\u4e86\u975e\u9650\u5b9a\u901a\u914d\u7b26\uff0c\u56e0\u4e3a<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;\">&lt;?&gt;<\/code>\u53ef\u4ee5\u7528\u4efb\u610f\u7c7b\u578b\u6765\u66ff\u4ee3\u3002<\/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;\"><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;\">List&lt;? extends T&gt;<\/code>\u548c<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;\">List &lt;? super T&gt;<\/code>\u4e4b\u95f4\u6709\u4ec0\u4e48\u533a\u522b \u2753<\/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;\">\u8fd9\u4e24\u4e2aList\u7684\u58f0\u660e\u90fd\u662f\u9650\u5b9a\u901a\u914d\u7b26\u7684\u4f8b\u5b50\uff0c<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;\">List&lt;? extends T&gt;<\/code>\u53ef\u4ee5\u63a5\u53d7\u4efb\u4f55\u7ee7\u627f\u81eaT\u7684\u7c7b\u578b\u7684List\uff0c\u800c<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;\">List&lt;? super T&gt;<\/code>\u53ef\u4ee5\u63a5\u53d7\u4efb\u4f55T\u7684\u7236\u7c7b\u6784\u6210\u7684<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;\">List<\/code>\u3002\u4f8b\u5982<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;\">List&lt;? extends Number&gt;<\/code>\u53ef\u4ee5\u63a5\u53d7<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;\">List&lt;Integer&gt;<\/code>\u6216<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;\">List&lt;Float&gt;<\/code>\u3002<\/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;\">\u5982\u4f55\u7f16\u5199\u4e00\u4e2a\u6cdb\u578b\u65b9\u6cd5\uff0c\u8ba9\u5b83\u80fd\u63a5\u53d7\u6cdb\u578b\u53c2\u6570\u5e76\u8fd4\u56de\u6cdb\u578b\u7c7b\u578b?<\/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;\">\u7f16\u5199\u6cdb\u578b\u65b9\u6cd5\u5e76\u4e0d\u56f0\u96be\uff0c\u4f60\u9700\u8981\u7528\u6cdb\u578b\u7c7b\u578b\u6765\u66ff\u4ee3\u539f\u59cb\u7c7b\u578b\uff0c\u6bd4\u5982\u4f7f\u7528<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;\">T, E or K,V<\/code>\u7b49\u88ab\u5e7f\u6cdb\u8ba4\u53ef\u7684\u7c7b\u578b\u5360\u4f4d\u7b26\u3002\u6700\u7b80\u5355\u7684\u60c5\u51b5\u4e0b\uff0c\u4e00\u4e2a\u6cdb\u578b\u65b9\u6cd5\u53ef\u80fd\u4f1a\u50cf\u8fd9\u6837:<\/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\/20230528042541369.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;V&nbsp;<span style=\"color: rgb(97, 174, 238);line-height: 26px;\">put<\/span><span style=\"line-height: 26px;\">(K&nbsp;key,&nbsp;V&nbsp;value)<\/span>&nbsp;<\/span>{<br  \/>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"color: rgb(198, 120, 221);line-height: 26px;\">return<\/span>&nbsp;cache.put(key,&nbsp;value);<br  \/>}<br  \/><\/code><\/pre>\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\u5199\u4e00\u6bb5\u6cdb\u578b\u7a0b\u5e8f\u6765\u5b9e\u73b0LRU\u7f13\u5b58?<\/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;\"><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;\">LinkedHashMap<\/code>\u53ef\u4ee5\u7528\u6765\u5b9e\u73b0\u56fa\u5b9a\u5927\u5c0f\u7684LRU\u7f13\u5b58\uff0c\u5f53LRU\u7f13\u5b58\u5df2\u7ecf\u6ee1\u4e86\u7684\u65f6\u5019\uff0c\u5b83\u4f1a\u628a\u6700\u8001\u7684\u952e\u503c\u5bf9\u79fb\u51fa\u7f13\u5b58\u3002LinkedHashMap\u63d0\u4f9b\u4e86\u4e00\u4e2a\u79f0\u4e3a<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;\">removeEldestEntry()<\/code>\u7684\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u4f1a\u88abput()\u548cputAll()\u8c03\u7528\u6765\u5220\u9664\u6700\u8001\u7684\u952e\u503c\u5bf9\u3002<\/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;\">\u4f60\u53ef\u4ee5\u628a<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;\">List&lt;String&gt;<\/code>\u4f20\u9012\u7ed9\u4e00\u4e2a\u63a5\u53d7<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;\">List&lt;Object&gt;<\/code>\u53c2\u6570\u7684\u65b9\u6cd5\u5417\uff1f<\/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;\">\u56e0\u4e3a\u4e4d\u770b\u8d77\u6765<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;\">String<\/code>\u662f\u4e00\u79cd<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;\">Object<\/code>\uff0c\u6240\u4ee5<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;\">List&lt;String&gt;<\/code>\u5e94\u5f53\u53ef\u4ee5\u7528\u5728\u9700\u8981&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;\">List&lt;Object&gt;<\/code>\u7684\u5730\u65b9\uff0c\u4f46\u662f\u4e8b\u5b9e\u5e76\u975e\u5982\u6b64\u3002\u771f\u8fd9\u6837\u505a\u7684\u8bdd\u4f1a\u5bfc\u81f4\u7f16\u8bd1\u9519\u8bef\u3002\u5982\u679c\u4f60\u518d\u6df1\u4e00\u6b65\u8003\u8651\uff0c\u4f60\u4f1a\u53d1\u73b0Java\u8fd9\u6837\u505a\u662f\u6709\u610f\u4e49\u7684\uff0c\u56e0\u4e3a<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;\">List&lt;Object&gt;<\/code>&nbsp;\u53ef\u4ee5\u5b58\u50a8\u4efb\u4f55\u7c7b\u578b\u7684\u5bf9\u8c61\u5305\u62ec<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;\">String, Integer<\/code>\u7b49\u7b49\uff0c\u800c<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;\">List&lt;String&gt;<\/code>\u5374\u53ea\u80fd\u7528\u6765\u5b58\u50a8<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;\">String<\/code>\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\/20230528042541369.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;\">List&lt;Object&gt;&nbsp;objectList;<br  \/>List&lt;String&gt;&nbsp;stringList;<br  \/>objectList&nbsp;=&nbsp;stringList;&nbsp;&nbsp;<span style=\"color: rgb(92, 99, 112);font-style: italic;line-height: 26px;\">\/\/compilation&nbsp;error&nbsp;incompatible&nbsp;types<\/span><br  \/><\/code><\/pre>\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;\"><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;\">Array<\/code>\u4e2d\u53ef\u4ee5\u7528\u6cdb\u578b\u5417?<\/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;\">\u524d\u63d0\u662f\u4f60\u8981\u77e5\u9053Array\u4e8b\u5b9e\u4e0a\u5e76\u4e0d\u652f\u6301\u6cdb\u578b\uff0c\u56e0\u4e3aList\u53ef\u4ee5\u63d0\u4f9b\u7f16\u8bd1\u671f\u7684\u7c7b\u578b\u5b89\u5168\u4fdd\u8bc1\uff0c\u800cArray\u5374\u4e0d\u80fd\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;\">blog\u5730\u5740&nbsp;\u83b7\u53d6\u66f4\u591a\u5185\u5bb9~<\/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=\"1\"  data-type=\"jpeg\" data-w=\"440\" 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\/20230528042543851.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=\"440\" 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\/20230528042543851.jpeg\"><\/noscript><figcaption style=\"margin-top: 5px;text-align: center;color: rgb(136, 136, 136);font-size: 13px;\">\u70b9\u8d5e<\/figcaption><\/figure>\n<\/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>Java\u679a\u4e3e\u4e0e\u6cdb\u578b \u524d\u8a00 \u672c\u8282\u7ed9\u5927\u5bb6\u8bb2\u8bb2&nbsp;\u300c\u679a\u4e3e\u4e0e\u6cdb\u578b\u300d&nbsp;\uff0c\u672c\u7bc7\u5185\u5bb9\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206: \u679a\u4e3e\u5b9a\u4e49\u548c\u4f7f\u7528 \u6cdb &#8230;<\/p>\n","protected":false},"author":1,"featured_media":1383,"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-1385","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\/20230528042542223-150x150.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042543851.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042542223-300x128.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042542223.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042543851.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042542223-300x128.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042542223.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042542223.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042543851.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230528042543851.jpeg","id":"image1"}],"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":324,"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\/1385","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=1385"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/1385\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/1383"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}