Java: get all variable names in a class

前端 未结 4 2073
醉酒成梦
醉酒成梦 2020-11-27 12:40

I have a class and I want to find all of its public fields (not methods). How can I do this?

Thanks!

4条回答
  •  醉酒成梦
    2020-11-27 13:00

    https://docs.oracle.com/javase/tutorial/reflect/class/classMembers.html also has charts for locating methods and constructors.

提交回复
热议问题