サイトメニュー
|
|
- 追加された行はこの色です。
- 削除された行はこの色です。
- へ行く。
String[] array = { "A", "C", "B" };
Class cls = Class.forName("java.util.Arrays");
Method method =
cls.getDeclaredMethod("sort", new Class[] { Object[].class });
method.invoke(null, new Object[] { array });
System.out.println(array[0] + array[1] + array[2]);
Class cls = Class.forName("java.lang.Integer");
Method method1 =
cls.getDeclaredMethod("toString", new Class[] { int.class });
Method method2 =
cls.getDeclaredMethod("toString", new Class[] { int.class, int.class });
String string1 =
(String) method1.invoke(null, new Object[] { new Integer(255) });
String string2 =
(String) method2.invoke(null, new Object[] { new Integer(255), new Integer(16) });
|