上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页
摘要: import java.lang.reflect.Array; public class ChangeArrayDemo { public static void main(String[] args) { int temp[] = { 1, 2, 3 }; int newTemp[] = (int[]) arrayInc(temp, 5)... 阅读全文
posted @ 2014-09-04 17:55 塔斯曼 阅读(218) 评论(0) 推荐(0) 编辑
摘要: import java.lang.reflect.Array; public class ClassArrayDemo { public static void main(String[] args) { int temp[] = { 1, 2, 3 }; Class c = temp.getClass().getComponentType... 阅读全文
posted @ 2014-09-04 17:19 塔斯曼 阅读(231) 评论(0) 推荐(0) 编辑
摘要: import java.lang.reflect.Field; public class InvokeFieldDemo { public static void main(String[] args) throws Exception { Class cl = null; Object obj = null; cl ... 阅读全文
posted @ 2014-09-04 15:23 塔斯曼 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-09-04 14:52 塔斯曼 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 一 ,调用无参方法: import java.lang.reflect.Method; public class InvokeSayJapanDemo { public static void main(String[] args) { Class c1=null; try { c1=Class.forName(PersonZ.cla... 阅读全文
posted @ 2014-09-03 17:47 塔斯曼 阅读(194) 评论(0) 推荐(0) 编辑
摘要: interface China { public static final String NATIONAL = "JAPAN"; public static final String AUTHOR = "SIGERU"; public void sayJapan(); public String sayHello(String name, int ag... 阅读全文
posted @ 2014-09-03 17:14 塔斯曼 阅读(296) 评论(0) 推荐(0) 编辑
摘要: import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; class Person { private String name; private int age; public Person(String name, int age) ... 阅读全文
posted @ 2014-09-03 16:27 塔斯曼 阅读(1023) 评论(0) 推荐(0) 编辑
摘要: class X { } public class GetClassDemo01 { public static void main(String[] args) { X x = new X(); System.out.println(x.getClass().getName()); Class c1=... 阅读全文
posted @ 2014-09-03 16:12 塔斯曼 阅读(413) 评论(0) 推荐(0) 编辑
摘要: enum ColorE { RED, GREEN, BLUE; } public class GetEnumContent { public static void main(String[] args) { // ColorE color=ColorE.BLUE; // System.out.println(color)... 阅读全文
posted @ 2014-09-03 10:47 塔斯曼 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 系统内建的Annotation: @Override:覆写的Annotation,方法覆写时使用,用于保证方法覆写的正确性。 @Deprecated:不赞成使用的Annotation,用来声明一个不建议使用的方法。 @SuppressWarning:压制安全警告的Annotation。 自定义: public @interface MyDefaultAnnotationValue ... 阅读全文
posted @ 2014-09-03 10:07 塔斯曼 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页