java reflection getFields for private member| accessing object name value dynamically

前端 未结 2 1820
难免孤独
难免孤独 2021-01-04 12:25

I want to print all of the class\'s properties with their name and values. I have used reflection, but getFields give me length of 0.

RateCode          


        
2条回答
  •  萌比男神i
    2021-01-04 13:22

    getFields only returns public fields. If you want all fields, see getDeclaredFields

提交回复
热议问题