Vincent's Labs
Technical Labs
星期三, 五月 09, 2007
How to access private fields through reflect?
sample code :
A a = new A("Hello Vincent");
Field field = a.getClass().getDeclaredField("a");
field.setAccessible(true);
System.out.println(field.get(a).toString());
没有评论:
发表评论
较新的博文
较早的博文
主页
没有评论:
发表评论