{"id":2246,"date":"2025-03-02T11:24:17","date_gmt":"2025-03-02T03:24:17","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=2246"},"modified":"2025-03-02T11:24:17","modified_gmt":"2025-03-02T03:24:17","slug":"java-%e5%8f%8d%e5%b0%84%ef%bc%88reflection%ef%bc%89%e4%b8%89","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/03\/02\/java-%e5%8f%8d%e5%b0%84%ef%bc%88reflection%ef%bc%89%e4%b8%89\/","title":{"rendered":"Java \u53cd\u5c04\uff08Reflection\uff09\u4e09"},"content":{"rendered":"\n<p>\u5728 Java \u4e2d\uff0c\u53cd\u5c04\u673a\u5236\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u52a8\u6001\u7f16\u7a0b\u80fd\u529b\u3002\u5bf9\u4e8e\u66f4\u9ad8\u9636\u7684\u7528\u6cd5\uff0c\u6211\u4eec\u901a\u5e38\u6d89\u53ca\u5230\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u52a8\u6001\u4ee3\u7406\u7684\u9ad8\u7ea7\u5e94\u7528<\/strong><\/li>\n\n\n\n<li><strong>\u53cd\u5c04\u4e0e\u6cdb\u578b\u7684\u7ed3\u5408<\/strong><\/li>\n\n\n\n<li><strong>\u53cd\u5c04\u4e0e\u6ce8\u89e3\u7684\u7ed3\u5408<\/strong><\/li>\n\n\n\n<li><strong>\u53cd\u5c04\u4e0e\u5b57\u8282\u7801\u64cd\u4f5c<\/strong><\/li>\n\n\n\n<li><strong>\u53cd\u5c04\u5728\u6846\u67b6\u8bbe\u8ba1\u4e2d\u7684\u9ad8\u7ea7\u5e94\u7528<\/strong><\/li>\n\n\n\n<li><strong>\u8bbf\u95ee\u63a7\u5236\u548c\u5b89\u5168\u6027\u5904\u7406<\/strong><\/li>\n<\/ol>\n\n\n\n<p>\u4ee5\u4e0b\u5c06\u8fdb\u4e00\u6b65\u8bb2\u89e3\u8fd9\u4e9b\u9ad8\u9636\u7528\u6cd5\uff1a<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>\u52a8\u6001\u4ee3\u7406\u7684\u9ad8\u7ea7\u5e94\u7528<\/strong><\/h3>\n\n\n\n<p>\u52a8\u6001\u4ee3\u7406\u4e0d\u4ec5\u53ef\u4ee5\u7528\u4e8e\u63a5\u53e3\u7684\u4ee3\u7406\uff0c\u8fd8\u53ef\u4ee5\u7528\u4e8e\u589e\u5f3a\u7c7b\u7684\u529f\u80fd\uff0c\u5c24\u5176\u5728 AOP\uff08\u9762\u5411\u5207\u9762\u7f16\u7a0b\uff09\u4e2d\uff0c\u52a8\u6001\u4ee3\u7406\u8d77\u7740\u5173\u952e\u4f5c\u7528\u3002<\/p>\n\n\n\n<p><strong>\u9ad8\u7ea7\u5e94\u7528\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u591a\u4e2a\u63a5\u53e3\u7684\u52a8\u6001\u4ee3\u7406\uff1a<\/strong> \u52a8\u6001\u4ee3\u7406\u4e0d\u4ec5\u4ec5\u652f\u6301\u5bf9\u5355\u4e2a\u63a5\u53e3\u7684\u4ee3\u7406\uff0c\u8fd8\u53ef\u4ee5\u4ee3\u7406\u591a\u4e2a\u63a5\u53e3\uff0c\u751f\u6210\u4e00\u4e2a\u5b9e\u73b0\u4e86\u6240\u6709\u63a5\u53e3\u7684\u4ee3\u7406\u7c7b\u3002 <strong>\u793a\u4f8b\uff1a<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  interface Greet {\n      void sayHello();\n  }\n\n  interface Farewell {\n      void sayGoodbye();\n  }\n\n  class MyInvocationHandler implements InvocationHandler {\n      private Object target;\n\n      public MyInvocationHandler(Object target) {\n          this.target = target;\n      }\n\n      @Override\n      public Object invoke(Object proxy, Method method, Object&#91;] args) throws Throwable {\n          System.out.println(\"Before method call\");\n          Object result = method.invoke(target, args);\n          System.out.println(\"After method call\");\n          return result;\n      }\n  }\n\n  public class Test {\n      public static void main(String&#91;] args) {\n          Greet greet = new Greet() {\n              @Override\n              public void sayHello() {\n                  System.out.println(\"Hello!\");\n              }\n          };\n          Farewell farewell = new Farewell() {\n              @Override\n              public void sayGoodbye() {\n                  System.out.println(\"Goodbye!\");\n              }\n          };\n\n          Object proxy = Proxy.newProxyInstance(\n                  Test.class.getClassLoader(),\n                  new Class&#91;]{Greet.class, Farewell.class},\n                  new MyInvocationHandler(greet)\n          );\n          ((Greet) proxy).sayHello();\n          ((Farewell) proxy).sayGoodbye();\n      }\n  }<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong> \u4e0a\u9762\u4ee3\u7801\u4e2d\u521b\u5efa\u4e86\u4e00\u4e2a\u540c\u65f6\u5b9e\u73b0 <code>Greet<\/code> \u548c <code>Farewell<\/code> \u63a5\u53e3\u7684\u52a8\u6001\u4ee3\u7406\u3002<code>Proxy.newProxyInstance()<\/code> \u53ef\u4ee5\u63a5\u53d7\u591a\u4e2a\u63a5\u53e3\uff0c\u5e76\u5c06\u65b9\u6cd5\u8c03\u7528\u59d4\u6258\u7ed9 <code>InvocationHandler<\/code>\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u81ea\u5b9a\u4e49\u4ee3\u7406\u6a21\u5f0f\uff08AOP\uff09\uff1a<\/strong> \u4f7f\u7528\u52a8\u6001\u4ee3\u7406\u548c\u53cd\u5c04\u7ed3\u5408\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c Spring AOP \u7684\u529f\u80fd\u3002\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u76ee\u6807\u65b9\u6cd5\u4f1a\u88ab\u589e\u5f3a\uff08\u5982\u65e5\u5fd7\u3001\u4e8b\u52a1\u7b49\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>\u53cd\u5c04\u4e0e\u6cdb\u578b\u7684\u7ed3\u5408<\/strong><\/h3>\n\n\n\n<p>Java \u6cdb\u578b\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u7279\u6027\uff0c\u4f46\u5b83\u5728\u7f16\u8bd1\u65f6\u4f1a\u8fdb\u884c\u7c7b\u578b\u64e6\u9664\u3002\u901a\u8fc7\u53cd\u5c04\uff0c\u6211\u4eec\u53ef\u4ee5\u7ed5\u8fc7\u7c7b\u578b\u64e6\u9664\uff0c\u83b7\u53d6\u6cdb\u578b\u7684\u5177\u4f53\u7c7b\u578b\u4fe1\u606f\u3002<\/p>\n\n\n\n<p><strong>\u83b7\u53d6\u6cdb\u578b\u7c7b\u578b\uff1a<\/strong><\/p>\n\n\n\n<p>\u4f7f\u7528\u53cd\u5c04\u83b7\u53d6\u6cdb\u578b\u7c7b\u578b\u901a\u5e38\u4f1a\u4f7f\u7528 <code>ParameterizedType<\/code> \u7c7b\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.lang.reflect.*;\nimport java.util.*;\n\nclass MyClass&lt;T&gt; {\n    private List&lt;T&gt; list;\n\n    public MyClass(List&lt;T&gt; list) {\n        this.list = list;\n    }\n\n    public List&lt;T&gt; getList() {\n        return list;\n    }\n}\n\npublic class Test {\n    public static void main(String&#91;] args) throws Exception {\n        Type genericType = MyClass.class.getDeclaredField(\"list\").getGenericType();\n        if (genericType instanceof ParameterizedType) {\n            ParameterizedType parameterizedType = (ParameterizedType) genericType;\n            Type actualTypeArgument = parameterizedType.getActualTypeArguments()&#91;0];\n            System.out.println(\"Generic Type: \" + actualTypeArgument);\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Generic Type: class java.lang.String<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0a\u8ff0\u793a\u4f8b\u4e2d\uff0c\u901a\u8fc7\u53cd\u5c04\u83b7\u53d6 <code>MyClass<\/code> \u7c7b\u4e2d <code>list<\/code> \u5b57\u6bb5\u7684\u6cdb\u578b\u7c7b\u578b\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 <code>ParameterizedType<\/code> \u6765\u83b7\u53d6\u5b57\u6bb5\u7684\u6cdb\u578b\u7c7b\u578b\uff0c\u5e76\u901a\u8fc7 <code>getActualTypeArguments()<\/code> \u65b9\u6cd5\u6765\u83b7\u53d6\u5b9e\u9645\u7c7b\u578b\u53c2\u6570\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>\u53cd\u5c04\u4e0e\u6ce8\u89e3\u7684\u7ed3\u5408<\/strong><\/h3>\n\n\n\n<p>\u53cd\u5c04\u548c\u6ce8\u89e3\u5728\u6846\u67b6\u4e2d\u7ecf\u5e38\u7ed3\u5408\u4f7f\u7528\u3002\u4f8b\u5982\uff0c\u5728 Spring \u548c Hibernate \u7b49\u6846\u67b6\u4e2d\uff0c\u6ce8\u89e3\u7528\u4e8e\u6807\u8bc6\u7c7b\u3001\u5b57\u6bb5\u3001\u65b9\u6cd5\u7684\u5143\u6570\u636e\uff0c\u800c\u53cd\u5c04\u5219\u7528\u4e8e\u52a8\u6001\u5730\u8bfb\u53d6\u8fd9\u4e9b\u6ce8\u89e3\uff0c\u4ece\u800c\u6267\u884c\u76f8\u5e94\u7684\u903b\u8f91\u3002<\/p>\n\n\n\n<p><strong>\u6ce8\u89e3\u5904\u7406\u5668\uff1a<\/strong><br>\u6ce8\u89e3\u4e0e\u53cd\u5c04\u7ed3\u5408\u7684\u4e00\u79cd\u9ad8\u7ea7\u7528\u6cd5\u662f\u521b\u5efa\u81ea\u5b9a\u4e49\u6ce8\u89e3\u5904\u7406\u5668\uff0c\u5b83\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u89e3\u6790\u6ce8\u89e3\uff0c\u5e76\u6839\u636e\u6ce8\u89e3\u7684\u5143\u6570\u636e\u6765\u52a8\u6001\u5730\u6267\u884c\u7279\u5b9a\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.lang.annotation.*;\nimport java.lang.reflect.*;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target(ElementType.METHOD)\n@interface LogExecutionTime {\n}\n\nclass MyClass {\n    @LogExecutionTime\n    public void someMethod() {\n        System.out.println(\"Method Executed\");\n    }\n}\n\npublic class Test {\n    public static void main(String&#91;] args) throws Exception {\n        Class&lt;?&gt; cls = MyClass.class;\n        Method method = cls.getMethod(\"someMethod\");\n\n        if (method.isAnnotationPresent(LogExecutionTime.class)) {\n            long start = System.currentTimeMillis();\n            method.invoke(cls.getDeclaredConstructor().newInstance());\n            long end = System.currentTimeMillis();\n            System.out.println(\"Execution Time: \" + (end - start) + \"ms\");\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Method Executed\nExecution Time: 0ms<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u91ca\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>LogExecutionTime<\/code> \u6ce8\u89e3\u6807\u8bb0\u4e86 <code>someMethod<\/code> \u65b9\u6cd5\u3002\u5728 <code>Test<\/code> \u7c7b\u4e2d\uff0c\u901a\u8fc7\u53cd\u5c04\u8bfb\u53d6\u6ce8\u89e3\u5e76\u5728\u6267\u884c\u65b9\u6cd5\u524d\u540e\u8ba1\u7b97\u5176\u6267\u884c\u65f6\u95f4\u3002\u8fd9\u79cd\u7528\u6cd5\u5e38\u89c1\u4e8e\u65e5\u5fd7\u3001\u6027\u80fd\u76d1\u63a7\u3001\u4e8b\u52a1\u7ba1\u7406\u7b49\u9886\u57df\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>\u53cd\u5c04\u4e0e\u5b57\u8282\u7801\u64cd\u4f5c<\/strong><\/h3>\n\n\n\n<p>\u53cd\u5c04\u548c\u5b57\u8282\u7801\u64cd\u4f5c\u76f8\u7ed3\u5408\uff0c\u5e38\u7528\u4e8e\u4e00\u4e9b\u6846\u67b6\u548c\u5e93\u7684\u5e95\u5c42\u5b9e\u73b0\u3002\u6bd4\u5982\u5728 Spring \u548c Hibernate \u4e2d\uff0c\u53cd\u5c04\u548c\u5b57\u8282\u7801\u751f\u6210\uff08\u5982 CGLIB\uff09\u7ecf\u5e38\u7528\u4e8e\u52a8\u6001\u521b\u5efa\u4ee3\u7406\u7c7b\uff0c\u6216\u4fee\u6539\u7c7b\u7684\u884c\u4e3a\u3002<\/p>\n\n\n\n<p><strong>\u5b57\u8282\u7801\u64cd\u4f5c\u5de5\u5177\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Javassist\uff1a<\/strong> Javassist \u662f\u4e00\u4e2a\u5b57\u8282\u7801\u64cd\u4f5c\u5de5\u5177\uff0c\u53ef\u4ee5\u901a\u8fc7\u53cd\u5c04\u52a8\u6001\u4fee\u6539\u7c7b\u7684\u5b57\u8282\u7801\u3002<\/li>\n\n\n\n<li><strong>ASM\uff1a<\/strong> ASM \u662f\u4e00\u4e2a\u4f4e\u7ea7\u7684\u5b57\u8282\u7801\u64cd\u4f5c\u5e93\uff0c\u5b83\u53ef\u4ee5\u7528\u6765\u521b\u5efa\u548c\u4fee\u6539 Java \u5b57\u8282\u7801\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4f8b\u5982\uff0cSpring \u52a8\u6001\u4ee3\u7406\u53ef\u4ee5\u4f7f\u7528 CGLIB \u5e93\u6765\u521b\u5efa\u76ee\u6807\u7c7b\u7684\u5b50\u7c7b\uff0c\u901a\u8fc7\u53cd\u5c04\u4fee\u6539\u5176\u884c\u4e3a\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>\u53cd\u5c04\u5728\u6846\u67b6\u8bbe\u8ba1\u4e2d\u7684\u9ad8\u7ea7\u5e94\u7528<\/strong><\/h3>\n\n\n\n<p>\u53cd\u5c04\u5728\u8bb8\u591a\u6846\u67b6\u8bbe\u8ba1\u4e2d\u626e\u6f14\u7740\u6838\u5fc3\u89d2\u8272\uff0c\u5c24\u5176\u662f\u5728\u4f9d\u8d56\u6ce8\u5165\u3001AOP\u3001ORM\uff08\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\uff09\u7b49\u65b9\u9762\u3002\u6bd4\u5982 Spring \u6846\u67b6\u4e2d\uff0c\u53cd\u5c04\u7528\u6765\u6839\u636e\u914d\u7f6e\u7684 bean \u540d\u79f0\u548c\u7c7b\u578b\uff0c\u52a8\u6001\u521b\u5efa\u548c\u6ce8\u5165\u5bf9\u8c61\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4f9d\u8d56\u6ce8\u5165\uff1a<\/strong> Spring \u5bb9\u5668\u4f1a\u901a\u8fc7\u53cd\u5c04\u6765\u626b\u63cf\u548c\u6ce8\u5165\u7c7b\u7684\u6784\u9020\u51fd\u6570\u3001\u5b57\u6bb5\u548c\u65b9\u6cd5\uff0c\u52a8\u6001\u5730\u5c06\u76f8\u5173\u4f9d\u8d56\u6ce8\u5165\u5230\u7c7b\u7684\u5b9e\u4f8b\u4e2d\u3002<\/li>\n\n\n\n<li><strong>AOP\uff1a<\/strong> Spring AOP \u4e2d\uff0c\u53cd\u5c04\u548c\u52a8\u6001\u4ee3\u7406\u7ed3\u5408\u4f7f\u7528\uff0c\u5728\u65b9\u6cd5\u8c03\u7528\u524d\u540e\u589e\u5f3a\u529f\u80fd\uff08\u5982\u65e5\u5fd7\u3001\u4e8b\u52a1\u7b49\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>\u53cd\u5c04\u4e0e\u8bbf\u95ee\u63a7\u5236\u548c\u5b89\u5168\u6027\u5904\u7406<\/strong><\/h3>\n\n\n\n<p>\u5728 Java \u4e2d\uff0c\u53cd\u5c04\u53ef\u4ee5\u7ed5\u8fc7\u8bbf\u95ee\u63a7\u5236\u68c0\u67e5\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u8fd9\u53ef\u80fd\u5f15\u53d1\u5b89\u5168\u95ee\u9898\u3002\u56e0\u6b64\uff0c\u53cd\u5c04\u64cd\u4f5c\u7ecf\u5e38\u9700\u8981\u5904\u7406\u8bbf\u95ee\u63a7\u5236\u95ee\u9898\u3002<\/p>\n\n\n\n<p><strong>\u8bbf\u95ee\u63a7\u5236\u4e0e\u53cd\u5c04\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>setAccessible(true)<\/code> \u65b9\u6cd5\uff1a<\/strong> \u901a\u8fc7 <code>setAccessible(true)<\/code>\uff0c\u53cd\u5c04\u53ef\u4ee5\u7ed5\u8fc7 Java \u7684\u8bbf\u95ee\u63a7\u5236\uff0c\u8bbf\u95ee\u79c1\u6709\u3001\u53d7\u4fdd\u62a4\u6216\u9ed8\u8ba4\u8bbf\u95ee\u6743\u9650\u7684\u5b57\u6bb5\u548c\u65b9\u6cd5\u3002 <strong>\u793a\u4f8b\uff1a<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>  class MyClass {\n      private String secret = \"This is a secret!\";\n  }\n\n  public class Test {\n      public static void main(String&#91;] args) throws Exception {\n          MyClass myClass = new MyClass();\n          Field field = MyClass.class.getDeclaredField(\"secret\");\n          field.setAccessible(true); \/\/\u7ed5\u8fc7\u8bbf\u95ee\u63a7\u5236\n          System.out.println(\"Secret: \" + field.get(myClass));\n      }\n  }<\/code><\/pre>\n\n\n\n<p><strong>\u5b89\u5168\u6027\u5904\u7406\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u5b89\u5168\u7ba1\u7406\u5668\u7684\u63a7\u5236\u4e0b\uff0c\u53cd\u5c04\u53ef\u80fd\u4f1a\u53d7\u5230\u9650\u5236\u3002\u5f00\u53d1\u8005\u9700\u8981\u4e86\u89e3\u53cd\u5c04\u53ef\u80fd\u5bf9\u5e94\u7528\u7684\u5b89\u5168\u6027\u5e26\u6765\u7684\u98ce\u9669\uff0c\u5e76\u91c7\u53d6\u9002\u5f53\u7684\u5b89\u5168\u63aa\u65bd\uff0c\u907f\u514d\u6ee5\u7528\u53cd\u5c04\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n\n\n\n<p>\u53cd\u5c04\u662f\u4e00\u4e2a\u5f3a\u5927\u4e14\u7075\u6d3b\u7684\u5de5\u5177\uff0c\u9002\u7528\u4e8e\u591a\u79cd\u573a\u666f\uff0c\u5305\u62ec\u52a8\u6001\u4ee3\u7406\u3001\u6846\u67b6\u5f00\u53d1\u3001\u6cdb\u578b\u5904\u7406\u3001\u5b57\u8282\u7801\u64cd\u4f5c\u7b49\u3002\u7136\u800c\uff0c\u4f7f\u7528\u53cd\u5c04\u65f6\u9700\u8981\u8003\u8651\u6027\u80fd\u3001\u5b89\u5168\u6027\u3001\u8bbf\u95ee\u63a7\u5236\u7b49\u95ee\u9898\u3002\u5728\u8bbe\u8ba1\u9ad8\u9636\u7684 Java \u5e94\u7528\u65f6\uff0c\u7406\u89e3\u53cd\u5c04\u7684\u5185\u90e8\u673a\u5236\u4ee5\u53ca\u5982\u4f55\u5728\u66f4\u590d\u6742\u7684\u7cfb\u7edf\u4e2d\u9ad8\u6548\u5229\u7528\u53cd\u5c04\uff0c\u5bf9\u4e8e\u6784\u5efa\u5f3a\u5927\u3001\u7075\u6d3b\u4e14\u5b89\u5168\u7684\u5e94\u7528\u81f3\u5173\u91cd\u8981\u3002<\/p>\n\n\n\n<p>\u66f4\u591a\u8be6\u7ec6\u5185\u5bb9\u8bf7\u5173\u6ce8\u5176\u4ed6\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 Java \u4e2d\uff0c\u53cd\u5c04\u673a\u5236\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u52a8\u6001\u7f16\u7a0b\u80fd\u529b\u3002\u5bf9\u4e8e\u66f4\u9ad8\u9636\u7684\u7528\u6cd5\uff0c\u6211\u4eec\u901a\u5e38\u6d89\u53ca\u5230\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\uff1a \u4ee5\u4e0b\u5c06\u8fdb\u4e00 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-2246","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=2246"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2246\/revisions"}],"predecessor-version":[{"id":2247,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2246\/revisions\/2247"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=2246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=2246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=2246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}