{"id":226,"date":"2017-08-23T10:32:03","date_gmt":"2017-08-23T10:32:03","guid":{"rendered":""},"modified":"2020-09-29T14:12:51","modified_gmt":"2020-09-29T06:12:51","slug":"java%e7%9a%84%e5%8f%8d%e5%b0%84%e6%9c%ba%e5%88%b6","status":"publish","type":"post","link":"http:\/\/weizn.net\/?p=226","title":{"rendered":"Java\u7684\u53cd\u5c04\u673a\u5236"},"content":{"rendered":"<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\"><strong>\u4e00\u00a0 \u53cd\u5c04\u673a\u5236\u7684\u6982\u5ff5:<\/strong><\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\">\u6307\u5728\u8fd0\u884c\u72b6\u6001\u4e2d,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u7c7b,\u90fd\u80fd\u591f\u77e5\u9053\u8fd9\u4e2a\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u5bf9\u8c61,\u90fd\u80fd\u8c03\u7528\u5b83\u7684\u4efb\u610f\u4e00\u4e2a\u65b9\u6cd5.\u8fd9\u79cd\u52a8\u6001\u83b7\u53d6\u4fe1\u606f,\u4ee5\u53ca\u52a8\u6001\u8c03\u7528\u5bf9\u8c61\u65b9\u6cd5\u7684\u529f\u80fd\u53ebjava\u8bed\u8a00\u7684\u53cd\u5c04\u673a\u5236.<\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\"><strong>\u4e8c\u00a0 \u53cd\u5c04\u673a\u5236\u7684\u5e94\u7528:<\/strong><\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\">\u751f\u6210\u52a8\u6001\u4ee3\u7406,\u9762\u5411\u5207\u7247\u7f16\u7a0b(\u5728\u8c03\u7528\u65b9\u6cd5\u7684\u524d\u540e\u5404\u52a0\u6808\u5e27).<\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\"><strong>\u4e09\u00a0 \u53cd\u5c04\u673a\u5236\u7684\u539f\u7406:<\/strong><\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\">1\u00a0 \u9996\u5148\u660e\u786e\u7684\u6982\u5ff5: \u4e00\u5207\u7686\u5bf9\u8c61&#8212;-\u7c7b\u4e5f\u662f\u5bf9\u8c61.<\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\">2\u00a0 \u7136\u540e\u77e5\u9053\u7c7b\u4e2d\u7684\u5185\u5bb9 :modifier \u00a0constructor \u00a0field \u00a0method.<\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\">3\u00a0 \u5176\u6b21\u660e\u767d\u52a0\u8f7d: \u5f53Animal.class\u5728\u786c\u76d8\u4e2d\u65f6,\u662f\u4e00\u4e2a\u6587\u4ef6,\u5f53\u8f7d\u5165\u5230\u5185\u5b58\u4e2d,\u53ef\u4ee5\u8ba4\u4e3a\u662f\u4e00\u4e2a\u5bf9\u8c61,\u662fjava.lang.class\u7684\u5bf9\u8c61.<\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\"><span style=\"font-size: 14px;\"><strong>\u56db \u00a0\u53cd\u5c04\u673a\u5236\u7b80\u5355\u5b9e\u4f8b\u4ee3\u7801<\/strong><\/span><\/p>\n<pre data-enlighter-language=\"java\">\/*-----------------------------\u6784\u9020\u51fd\u6570\u4e0d\u5e26\u53c2\u6570--------------------------------*\/<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\nimport java.lang.reflect.Method;\n\npublic class ReflectTest {\n\u00a0 \u00a0 public static void main(String[] args) throws Exception{\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u83b7\u53d6\u7c7b\n\u00a0 \u00a0 \u00a0 \u00a0 Class&lt;?&gt; c = Class.forName(\"Processor\");\n\u00a0 \u00a0 \u00a0 \u00a0 \/*\n\u00a0 \u00a0 \u00a0 \u00a0 \u83b7\u53d6\u67d0\u4e2a\u7279\u5b9a\u7684\u65b9\u6cd5\n\u00a0 \u00a0 \u00a0 \u00a0 \u901a\u8fc7\uff1a\u65b9\u6cd5\u540d+\u5f62\u53c2\u5217\u8868\n\u00a0 \u00a0 \u00a0 \u00a0 *\/\n\u00a0 \u00a0 \u00a0 \u00a0 Method m = c.getDeclaredMethod(\"print\",String.class);\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u901a\u8fc7\u53cd\u5c04\u673a\u5236\u6267\u884cprint\u65b9\u6cd5.\n\u00a0 \u00a0 \u00a0 \u00a0 Object o = c.newInstance();\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8c03\u7528o\u5bf9\u8c61\u7684m\u65b9\u6cd5,\u4f20\u9012\u53c2\u6570\uff0c\u65b9\u6cd5\u7684\u6267\u884c\u7ed3\u679c\u662fretValue\n\u00a0 \u00a0 \u00a0 \u00a0 Object retValue = m.invoke(o, \"Hello World\");\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(retValue);\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\"><\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\npublic class Processor {\n\u00a0 \u00a0 public String print(String str){\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(\"Function invoke succeeded. Parameter: \" + str);\n\u00a0 \u00a0 \u00a0 \u00a0 return \"Return String.\";\n\u00a0 \u00a0 }\n}<\/pre>\n<pre data-enlighter-language=\"java\">\/*---------------------------------------\u6784\u9020\u51fd\u6570\u5e26\u53c2\u6570-------------------------------------*\/<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.Method;\n\npublic class ReflectTest {\n\u00a0 \u00a0 public static void main(String[] args) throws Exception{\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u83b7\u53d6\u7c7b\n\u00a0 \u00a0 \u00a0 \u00a0 Class&lt;?&gt; c = Class.forName(\"Processor\");\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8bbe\u5b9a\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\n\u00a0 \u00a0 \u00a0 \u00a0 Class&lt;?&gt;[] parTypes=new Class&lt;?&gt;[2];\n\u00a0 \u00a0 \u00a0 \u00a0 parTypes[0]=String.class;\n\u00a0 \u00a0 \u00a0 \u00a0 parTypes[1]=int.class;\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u83b7\u53d6\u6784\u9020\u5668\n\u00a0 \u00a0 \u00a0 \u00a0 Constructor&lt;?&gt; con = c.getConstructor(parTypes);\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u521d\u59cb\u5316\u6784\u9020\u53c2\u6570\n\u00a0 \u00a0 \u00a0 \u00a0 Object[] pars=new Object[2];\n\u00a0 \u00a0 \u00a0 \u00a0 pars[0]=\"1234567890\";\n\u00a0 \u00a0 \u00a0 \u00a0 pars[1]=1024;\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u6784\u9020\u5bf9\u8c61\n\u00a0 \u00a0 \u00a0 \u00a0 Object o=con.newInstance(pars);\n\u00a0 \u00a0 \u00a0 \u00a0 \/*\n\u00a0 \u00a0 \u00a0 \u00a0 \u83b7\u53d6\u67d0\u4e2a\u7279\u5b9a\u7684\u65b9\u6cd5\n\u00a0 \u00a0 \u00a0 \u00a0 \u901a\u8fc7\uff1a\u65b9\u6cd5\u540d+\u5f62\u53c2\u5217\u8868\n\u00a0 \u00a0 \u00a0 \u00a0 *\/\n\u00a0 \u00a0 \u00a0 \u00a0 Method m = c.getDeclaredMethod(\"print\",String.class);\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8c03\u7528o\u5bf9\u8c61\u7684m\u65b9\u6cd5,\u4f20\u9012\u53c2\u6570\uff0c\u65b9\u6cd5\u7684\u6267\u884c\u7ed3\u679c\u662fretValue\n\u00a0 \u00a0 \u00a0 \u00a0 String retValue = (String)m.invoke(o, \"Hello World\");\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(retValue);\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\npublic class Processor {\n\u00a0 \u00a0 public Processor(String str, int i){\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(\"Constructor parameter: \" + str + \": \" + i);\n\u00a0 \u00a0 }\n\u00a0 \u00a0 public String print(String str){\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(\"Function invoke succeeded. Parameter: \" + str);\n\u00a0 \u00a0 \u00a0 \u00a0 return \"Return String.\";\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\"><\/pre>\n<pre data-enlighter-language=\"java\">\/*---------------------------------------\u53cd\u5c04\u56de\u8c03\u3001\u6570\u7ec4\u4f20\u53c2-------------------------------------*\/<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.Method;\n\npublic class ReflectTest {\n\u00a0 \u00a0 public static void main(String[] args) throws Exception{\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u83b7\u53d6\u7c7b\n\u00a0 \u00a0 \u00a0 \u00a0 Class&lt;?&gt; c = Class.forName(\"Processor\");\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8bbe\u5b9a\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\n\u00a0 \u00a0 \u00a0 \u00a0 Class&lt;?&gt;[] parTypes=new Class&lt;?&gt;[1];\n\u00a0 \u00a0 \u00a0 \u00a0 parTypes[0]=HandlerIntf.class;\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u83b7\u53d6\u6784\u9020\u5668\n\u00a0 \u00a0 \u00a0 \u00a0 Constructor&lt;?&gt; con = c.getConstructor(parTypes);\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u521d\u59cb\u5316\u6784\u9020\u53c2\u6570\n\u00a0 \u00a0 \u00a0 \u00a0 Object[] pars=new Object[1];\n\u00a0 \u00a0 \u00a0 \u00a0 pars[0]=new Handler();\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u6784\u9020\u5bf9\u8c61\n\u00a0 \u00a0 \u00a0 \u00a0 Object o=con.newInstance(pars);\n\u00a0 \u00a0 \u00a0 \u00a0 \/*\n\u00a0 \u00a0 \u00a0 \u00a0 \u83b7\u53d6\u67d0\u4e2a\u7279\u5b9a\u7684\u65b9\u6cd5\n\u00a0 \u00a0 \u00a0 \u00a0 \u901a\u8fc7\uff1a\u65b9\u6cd5\u540d+\u5f62\u53c2\u5217\u8868\n\u00a0 \u00a0 \u00a0 \u00a0 *\/\n\u00a0 \u00a0 \u00a0 \u00a0 Method m = c.getDeclaredMethod(\"print\",String.class);\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8c03\u7528o\u5bf9\u8c61\u7684m\u65b9\u6cd5,\u4f20\u9012\u53c2\u6570\uff0c\u65b9\u6cd5\u7684\u6267\u884c\u7ed3\u679c\u662fretValue\n\u00a0 \u00a0 \u00a0 \u00a0 String retValue = (String)m.invoke(o, \"Hello World\");\n\n\u00a0 \u00a0 \u00a0 \u00a0 Method m1 = c.getDeclaredMethod(\"print_list\", String[].class, int.class, String[].class);\n\u00a0 \u00a0 \u00a0 \u00a0 String[] strList = new String[]{\"11\", \"22\", \"33\"};\n\u00a0 \u00a0 \u00a0 \u00a0 String[] strList1 = new String[]{\"aa\", \"bb\", \"cc\"};\n\u00a0 \u00a0 \u00a0 \u00a0 m1.invoke(o, new Object[]{strList, 1, strList1});\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(retValue);\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\npublic class Processor {\n\u00a0 \u00a0 public Processor(HandlerIntf handler){\n\u00a0 \u00a0 \u00a0 \u00a0 handler.print();\n\u00a0 \u00a0 \u00a0 \u00a0 handler.print1(\"Callback.\");\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 public String print(String str){\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(\"Function invoke succeeded. Parameter: \" + str);\n\u00a0 \u00a0 \u00a0 \u00a0 return \"Return String.\";\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 public void print_list(String[] strList, int i, String[] strList1){\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(i);\n\n\u00a0 \u00a0 \u00a0 \u00a0 for(String str : strList){\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 System.out.println(str);\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\n\u00a0 \u00a0 \u00a0 \u00a0 for(String str : strList1){\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 System.out.println(str);\n\u00a0 \u00a0 \u00a0 \u00a0 }\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\npublic class Handler implements HandlerIntf {\n\u00a0 \u00a0 @Override\n\u00a0 \u00a0 public void print() {\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(\"I'm Interface.\");\n\u00a0 \u00a0 }\n\n\u00a0 \u00a0 @Override\n\u00a0 \u00a0 public void print1(String str) {\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(str);\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\npublic interface HandlerIntf {\n\u00a0 \u00a0 void print();\n\u00a0 \u00a0 void print1(String str);\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\"><\/pre>\n<pre data-enlighter-language=\"java\">\/*-----------------------------\u53cd\u5c04\u8c03\u7528\u7236\u7c7b\u65b9\u6cd5--------------------------------*\/<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/23.\n\u00a0*\/\nimport java.lang.reflect.Constructor;\nimport java.lang.reflect.Method;\n\npublic class ReflectTest {\n\u00a0 \u00a0 public static void main(String[] args) throws Exception{\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u83b7\u53d6\u7c7b\n\u00a0 \u00a0 \u00a0 \u00a0 Class&lt;?&gt; c = Class.forName(\"Subclass\");\n\u00a0 \u00a0 \u00a0 \u00a0 Class&lt;?&gt; c1 = Class.forName(\"Subclass\").getSuperclass();\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u83b7\u53d6\u6784\u9020\u5668\n\u00a0 \u00a0 \u00a0 \u00a0 Constructor&lt;?&gt; con = c.getConstructor();\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u6784\u9020\u5bf9\u8c61\n\u00a0 \u00a0 \u00a0 \u00a0 Object o=con.newInstance();\n\u00a0 \u00a0 \u00a0 \u00a0 \/*\n\u00a0 \u00a0 \u00a0 \u00a0 \u83b7\u53d6\u67d0\u4e2a\u7279\u5b9a\u7684\u65b9\u6cd5\n\u00a0 \u00a0 \u00a0 \u00a0 \u901a\u8fc7\uff1a\u65b9\u6cd5\u540d+\u5f62\u53c2\u5217\u8868\n\u00a0 \u00a0 \u00a0 \u00a0 *\/\n\u00a0 \u00a0 \u00a0 \u00a0 Method m = c1.getDeclaredMethod(\"print\", String.class);\n\u00a0 \u00a0 \u00a0 \u00a0 \/\/\u8c03\u7528o\u5bf9\u8c61\u7684m\u65b9\u6cd5,\u4f20\u9012\u53c2\u6570\uff0c\u65b9\u6cd5\u7684\u6267\u884c\u7ed3\u679c\u662fretValue\n\u00a0 \u00a0 \u00a0 \u00a0 m.invoke(o, \"Hello World\");\n\n\u00a0 \u00a0 \u00a0 \u00a0 Method m1 = c.getDeclaredMethod(\"sub_print\", String.class);\n\u00a0 \u00a0 \u00a0 \u00a0 m1.invoke(o, \"Hello Son\");\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/24.\n\u00a0*\/\npublic class Base {\n\u00a0 \u00a0 public void print(String str){\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(\"I'm your father. Paramter: \" + str);\n\u00a0 \u00a0 }\n}<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\/**\n\u00a0* Created by weizinan on 2017\/8\/24.\n\u00a0*\/\npublic class Subclass extends Base {\n\u00a0 \u00a0 public void sub_print(String str){\n\u00a0 \u00a0 \u00a0 \u00a0 System.out.println(\"I'm son. Parameter: \" + str);\n\u00a0 \u00a0 }\n}<\/pre>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<p style=\"margin: 10px auto; padding: 0px; line-height: 22.4px; white-space: normal; widows: 1;\">\n","protected":false},"excerpt":{"rendered":"<p style=\"margin:10px auto;padding:0px;line-height:22.4px;white-space:normal;widows:1;\">\n\t<span style=\"font-size:14px;\"><strong>\u4e00&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u6982\u5ff5:<\/strong><\/span>\n<\/p>\n<p style=\"margin:10px auto;padding:0px;line-height:22.4px;white-space:normal;widows:1;\">\n\t<span style=\"font-size:14px;\">\u6307\u5728\u8fd0\u884c\u72b6\u6001\u4e2d,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u7c7b,\u90fd\u80fd\u591f\u77e5\u9053\u8fd9\u4e2a\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u5bf9\u8c61,\u90fd\u80fd\u8c03\u7528\u5b83\u7684\u4efb\u610f\u4e00\u4e2a\u65b9\u6cd5.\u8fd9\u79cd\u52a8\u6001\u83b7\u53d6\u4fe1\u606f,\u4ee5\u53ca\u52a8\u6001\u8c03\u7528\u5bf9\u8c61\u65b9\u6cd5\u7684\u529f\u80fd\u53ebjava\u8bed\u8a00\u7684\u53cd\u5c04\u673a\u5236.<\/span>\n<\/p>\n<p style=\"margin:10px auto;padding:0px;line-height:22.4px;white-space:normal;widows:1;\">\n\t<span style=\"font-size:14px;\"><strong>\u4e8c&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u5e94\u7528:<\/strong><\/span>\n<\/p>\n<p style=\"margin:10px auto;padding:0px;line-height:22.4px;white-space:normal;widows:1;\">\n\t<span style=\"font-size:14px;\">\u751f\u6210\u52a8\u6001\u4ee3\u7406,\u9762\u5411\u5207\u7247\u7f16\u7a0b(\u5728\u8c03\u7528\u65b9\u6cd5\u7684\u524d\u540e\u5404\u52a0\u6808\u5e27).<\/span>\n<\/p>\n<p style=\"margin:10px auto;padding:0px;line-height:22.4px;white-space:normal;widows:1;\">\n\t<span style=\"font-size:14px;\"><strong>\u4e09&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u539f\u7406:<\/strong><\/span>\n<\/p>\n<p style=\"margin:10px auto;padding:0px;line-height:22.4px;white-space:normal;widows:1;\">\n\t<span style=\"font-size:14px;\">1&nbsp; \u9996\u5148\u660e\u786e\u7684\u6982\u5ff5: \u4e00\u5207\u7686\u5bf9\u8c61&#8212;-\u7c7b\u4e5f\u662f\u5bf9\u8c61.<\/span>\n<\/p>\n<p style=\"margin:10px auto;padding:0px;line-height:22.4px;white-space:normal;widows:1;\">\n\t<span style=\"font-size:14px;\">2&amp;&#8230;<\/span><\/p>\n","protected":false},"author":1,"featured_media":572,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[325],"tags":[],"class_list":["post-226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u7684\u53cd\u5c04\u673a\u5236 - Wayne&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/weizn.net\/?p=226\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u7684\u53cd\u5c04\u673a\u5236 - Wayne&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u4e00&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u6982\u5ff5:   \u6307\u5728\u8fd0\u884c\u72b6\u6001\u4e2d,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u7c7b,\u90fd\u80fd\u591f\u77e5\u9053\u8fd9\u4e2a\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u5bf9\u8c61,\u90fd\u80fd\u8c03\u7528\u5b83\u7684\u4efb\u610f\u4e00\u4e2a\u65b9\u6cd5.\u8fd9\u79cd\u52a8\u6001\u83b7\u53d6\u4fe1\u606f,\u4ee5\u53ca\u52a8\u6001\u8c03\u7528\u5bf9\u8c61\u65b9\u6cd5\u7684\u529f\u80fd\u53ebjava\u8bed\u8a00\u7684\u53cd\u5c04\u673a\u5236.   \u4e8c&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u5e94\u7528:   \u751f\u6210\u52a8\u6001\u4ee3\u7406,\u9762\u5411\u5207\u7247\u7f16\u7a0b(\u5728\u8c03\u7528\u65b9\u6cd5\u7684\u524d\u540e\u5404\u52a0\u6808\u5e27).   \u4e09&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u539f\u7406:   1&nbsp; \u9996\u5148\u660e\u786e\u7684\u6982\u5ff5: \u4e00\u5207\u7686\u5bf9\u8c61----\u7c7b\u4e5f\u662f\u5bf9\u8c61.   2&amp;...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/weizn.net\/?p=226\" \/>\n<meta property=\"og:site_name\" content=\"Wayne&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-23T10:32:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-29T06:12:51+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zinan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/weizn.net\/#website\",\"url\":\"http:\/\/weizn.net\/\",\"name\":\"Wayne&#039;s Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/weizn.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/weizn.net\/?p=226#primaryimage\",\"inLanguage\":\"zh-Hans\",\"url\":\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/java-debugging-tips-881x441-1.jpg\",\"contentUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/java-debugging-tips-881x441-1.jpg\",\"width\":881,\"height\":441},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/weizn.net\/?p=226#webpage\",\"url\":\"http:\/\/weizn.net\/?p=226\",\"name\":\"Java\\u7684\\u53cd\\u5c04\\u673a\\u5236 - Wayne&#039;s Blog\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=226#primaryimage\"},\"datePublished\":\"2017-08-23T10:32:03+00:00\",\"dateModified\":\"2020-09-29T06:12:51+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/weizn.net\/?p=226#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/weizn.net\/?p=226\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/weizn.net\/?p=226#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"http:\/\/weizn.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\\u7684\\u53cd\\u5c04\\u673a\\u5236\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/weizn.net\/?p=226#article\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/?p=226#webpage\"},\"author\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"headline\":\"Java\\u7684\\u53cd\\u5c04\\u673a\\u5236\",\"datePublished\":\"2017-08-23T10:32:03+00:00\",\"dateModified\":\"2020-09-29T06:12:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=226#webpage\"},\"wordCount\":12,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"image\":{\"@id\":\"http:\/\/weizn.net\/?p=226#primaryimage\"},\"thumbnailUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/java-debugging-tips-881x441-1.jpg\",\"articleSection\":[\"Java\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/weizn.net\/?p=226#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\",\"name\":\"zinan\",\"logo\":{\"@id\":\"http:\/\/weizn.net\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java\u7684\u53cd\u5c04\u673a\u5236 - Wayne&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/weizn.net\/?p=226","og_locale":"zh_CN","og_type":"article","og_title":"Java\u7684\u53cd\u5c04\u673a\u5236 - Wayne&#039;s Blog","og_description":"\u4e00&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u6982\u5ff5:   \u6307\u5728\u8fd0\u884c\u72b6\u6001\u4e2d,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u7c7b,\u90fd\u80fd\u591f\u77e5\u9053\u8fd9\u4e2a\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5,\u5bf9\u4e8e\u4efb\u610f\u4e00\u4e2a\u5bf9\u8c61,\u90fd\u80fd\u8c03\u7528\u5b83\u7684\u4efb\u610f\u4e00\u4e2a\u65b9\u6cd5.\u8fd9\u79cd\u52a8\u6001\u83b7\u53d6\u4fe1\u606f,\u4ee5\u53ca\u52a8\u6001\u8c03\u7528\u5bf9\u8c61\u65b9\u6cd5\u7684\u529f\u80fd\u53ebjava\u8bed\u8a00\u7684\u53cd\u5c04\u673a\u5236.   \u4e8c&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u5e94\u7528:   \u751f\u6210\u52a8\u6001\u4ee3\u7406,\u9762\u5411\u5207\u7247\u7f16\u7a0b(\u5728\u8c03\u7528\u65b9\u6cd5\u7684\u524d\u540e\u5404\u52a0\u6808\u5e27).   \u4e09&nbsp; \u53cd\u5c04\u673a\u5236\u7684\u539f\u7406:   1&nbsp; \u9996\u5148\u660e\u786e\u7684\u6982\u5ff5: \u4e00\u5207\u7686\u5bf9\u8c61----\u7c7b\u4e5f\u662f\u5bf9\u8c61.   2&amp;...","og_url":"http:\/\/weizn.net\/?p=226","og_site_name":"Wayne&#039;s Blog","article_published_time":"2017-08-23T10:32:03+00:00","article_modified_time":"2020-09-29T06:12:51+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zinan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/weizn.net\/#website","url":"http:\/\/weizn.net\/","name":"Wayne&#039;s Blog","description":"","publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/weizn.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"ImageObject","@id":"http:\/\/weizn.net\/?p=226#primaryimage","inLanguage":"zh-Hans","url":"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/java-debugging-tips-881x441-1.jpg","contentUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/java-debugging-tips-881x441-1.jpg","width":881,"height":441},{"@type":"WebPage","@id":"http:\/\/weizn.net\/?p=226#webpage","url":"http:\/\/weizn.net\/?p=226","name":"Java\u7684\u53cd\u5c04\u673a\u5236 - Wayne&#039;s Blog","isPartOf":{"@id":"http:\/\/weizn.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/weizn.net\/?p=226#primaryimage"},"datePublished":"2017-08-23T10:32:03+00:00","dateModified":"2020-09-29T06:12:51+00:00","breadcrumb":{"@id":"http:\/\/weizn.net\/?p=226#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/weizn.net\/?p=226"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/weizn.net\/?p=226#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/weizn.net\/"},{"@type":"ListItem","position":2,"name":"Java\u7684\u53cd\u5c04\u673a\u5236"}]},{"@type":"Article","@id":"http:\/\/weizn.net\/?p=226#article","isPartOf":{"@id":"http:\/\/weizn.net\/?p=226#webpage"},"author":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"headline":"Java\u7684\u53cd\u5c04\u673a\u5236","datePublished":"2017-08-23T10:32:03+00:00","dateModified":"2020-09-29T06:12:51+00:00","mainEntityOfPage":{"@id":"http:\/\/weizn.net\/?p=226#webpage"},"wordCount":12,"commentCount":0,"publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"image":{"@id":"http:\/\/weizn.net\/?p=226#primaryimage"},"thumbnailUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2020\/10\/java-debugging-tips-881x441-1.jpg","articleSection":["Java"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/weizn.net\/?p=226#respond"]}]},{"@type":["Person","Organization"],"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264","name":"zinan","logo":{"@id":"http:\/\/weizn.net\/#personlogo"}}]}},"_links":{"self":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=226"}],"version-history":[{"count":8,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions"}],"predecessor-version":[{"id":316,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/226\/revisions\/316"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/media\/572"}],"wp:attachment":[{"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}