java - this.getClass().getFields().length; always returns 0 -


i trying number of fields in particular class. technique using not working , returns 0:

this.getclass().getfields().length; 

how field count of particular class?

use this.getclass().getdeclaredfields().length getfields method accessible public fields - see documentation.


Comments

Popular posts from this blog

Java sticky instances of class com.mysql.jdbc.Field aggregating -