Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

公共技术点之 Java 反射 Reflection,内容有误。 #36

Closed
xiaoniao opened this issue Jul 3, 2015 · 3 comments
Closed

公共技术点之 Java 反射 Reflection,内容有误。 #36

xiaoniao opened this issue Jul 3, 2015 · 3 comments

Comments

@xiaoniao
Copy link

xiaoniao commented Jul 3, 2015

4 反射获取类中的字段 中
这里需要注意的是 getDeclaredMethod 和 getDeclaredMethods 包含 private、protected、default、public 的函数,并且通过这两个函数获取到的只是在自身中定义的函数,从父类中集成的函数不能够获取到。而 getMethod 和 getMethods 只包含 public 函数,父类中的公有函数也能够获取到。

应该为getDeclaredField 、getDeclaredFields 、getField 、getFields。

@dxjia
Copy link

dxjia commented Jul 3, 2015

field是获取成员变量吧

@Trinea
Copy link
Member

Trinea commented Jul 3, 2015

感谢反馈,这篇文章还没完全审核结束,晚点我看下。另外有问题也可以直接提交 PR

@Trinea
Copy link
Member

Trinea commented Jul 28, 2015

已修改

@Trinea Trinea closed this as completed Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants