How to get number of attributes in a java class?

Posted by llm on Stack Overflow See other posts from Stack Overflow or by llm
Published on 2010-04-21T18:06:46Z Indexed on 2010/04/21 18:13 UTC
Read the original article Hit count: 170

Filed under:
|
|

I have a java class containing all the columns of a database table as attributes (member variables) and corresponding getters and setters.

I want to have a method in this class called getColumnCount() that returns the number of columns (i.e. the number of attributes in the class)? How would I implement this without hardcoding the number? I am open to critisims on this in general and suggestions. Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about class