From 2633b672b0f2839e0d774bda6f2bab73f9aa4557 Mon Sep 17 00:00:00 2001 From: dingpeilong <77676182@qq.com> Date: Mon, 13 Jan 2020 18:50:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AC=AC=E5=8D=81=E4=B9=9D?= =?UTF-8?q?=E7=AB=A0=E7=9A=84=E4=B8=80=E4=BA=9B=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/book/19-Type-Information.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/book/19-Type-Information.md b/docs/book/19-Type-Information.md index 75dfa68..dd6514c 100644 --- a/docs/book/19-Type-Information.md +++ b/docs/book/19-Type-Information.md @@ -1361,12 +1361,12 @@ import java.util.regex.*; public class ShowMethods { private static String usage = - "usage:n" + - "ShowMethods qualified.class.namen" + - "To show all methods in class or:n" + - "ShowMethods qualified.class.name wordn" + - "To search for methods involving 'word'"; - private static Pattern p = Pattern.compile("\w+\."); + "usage:\n" + + "ShowMethods qualified.class.name\n" + + "To show all methods in class or:\n" + + "ShowMethods qualified.class.name word\n" + + "To search for methods involving 'word'"; + private static Pattern p = Pattern.compile("\\w+\\."); public static void main(String[] args) { if (args.length < 1) { @@ -1648,7 +1648,7 @@ class SelectingMethods { SomeMethods proxy = (SomeMethods) Proxy.newProxyInstance( SomeMethods.class.getClassLoader(), - new Class[]{Interface.class}, + new Class[]{ SomeMethods.class }, new MethodSelector(new Implementation())); proxy.boring1(); proxy.boring2(); @@ -2078,7 +2078,7 @@ public class NullRobot { newNullRobot(Class type) { return (Robot) Proxy.newProxyInstance( NullRobot.class.getClassLoader(), - new Class, + new Class[] { Null.class, Robot.class }, new NullRobotProxyHandler(type)); } @@ -2375,8 +2375,7 @@ class AnonymousA { private void w() { System.out.println("private C.w()"); } - } - ; + }; } } @@ -2432,8 +2431,8 @@ public class ModifyingPrivateFields { Field f = pf.getClass().getDeclaredField("i"); f.setAccessible(true); System.out.println( - "f.getInt(pf): " + f.getint(pf)); - f.setint(pf, 47); + "f.getInt(pf): " + f.getInt(pf)); + f.setInt(pf, 47); System.out.println(pf); f = pf.getClass().getDeclaredField("s"); f.setAccessible(true);