摘要: getFields()获得某个类的所有的公共(public)的字段,包括父类。 getDeclaredFields()获得某个类的所有申明的字段,即包括public、private和proteced,但是不包括父类的申明字段。 同样类似的还有getConstructors()和getDeclaredConstructors(),getMethods()和getDeclaredMethods()。转自:http://blog.163.com/hanyinlong@126/blog/static/9975148620111013101452210/ 阅读全文
posted @ 2013-08-31 17:40 horizon~~~ 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 转自:http://java.chinaitlab.com/base/836044.htmlpublic class BB{ public int i;}public class PP{ public static void f(final BB ref) //我的理解是无法修改ref { ref.i = 55; } public static void main(String args[]){ BB x = new BB(); f(x); System.out.println(x.i); //但事实上是修改了。。。,不知为什么???? }} final修饰基本类型... 阅读全文
posted @ 2013-08-31 15:45 horizon~~~ 阅读(1460) 评论(0) 推荐(0) 编辑