Is there any easy way to achieve this.
Let's say I have an array of string with the name of POJO's in there and I"m trying to print all the list of attributes, is there any way to achieve this easily?\
String [] nameofClass;
for(String name:nameofClass)
name.class.getDeclaredFields();
Thanks
Class.forName(name).getDeclaredFields() within your for loop is probably what you're looking for.
Note that name should be the full path of the class, i.e. not only TheClass but the.package.to.TheClass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With